|
Well, I've never programmed for CF, but the recommended way to determine when a control gets focus AFAIK are the Enter and Leave events.
However, why are you deriving from Control ? Unless you are creating a new control from scratch, if you want to add this functionality to existing controls (text boxes, buttons, and so on) I would rather subscribe to the events for the controls. You could write a little class that given the control reference in the constructor, it would subscribe and handle the events. Then you could apply it to any control with just one line of code.
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
Hello!
In C++ we could do m_listView.SetRedraw(TRUE) in order to block repainting of the list view control. Add some items to it and call m_listView.SetRedraw(FALSE) to allow drawing again. This was pretty fast.
Now my question: is there an equivalent to this in .NET? I've looked at the member list of ListView, but didn't find one that does that. Have I overlooked something?
Note: I do NOT want to use a virtual list view.
Thanks in advance and best regards
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Yes, you have ListView.BeginUpdate() and ListView.EndUpdate() .
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
Works perfectly! Many thanks!
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
You are welcome! I'm glad I could help!
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
|
|
|
|
|
I need to build TextBox control that will display baloon tooltip if entered value is invalid. The question is, how can I retrieve size of such tooltip to allocate it on right place? Thanks.
|
|
|
|
|
Hi,
I am working on Media File Steam Edition, and want to cut a file into many, and join two files. I am using DirecX9 SDK. I tried hard, but cant go on further with my own knowledge.
Can any knowledged person guide me for the same. I was working on .avi files, but now am thinking of .wmv files.
Any thing that can help me do the coding for joining and cutting media files will do.
Thanks,
Jc Shreyash Singh Parihar
|
|
|
|
|
I have metod
private void axWebBrowser1_NewWindow2(object sender, AxSHDocVw.DWebBrowserEvents2_NewWindow2Event e){
}
Help me please.
|
|
|
|
|
What is it that you want help with?
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I search a DataGridViewColumn which has the possibility to select a few Items (with Checkbox). It should be also possible to bind data to that control.
Knows anyone a control for Net2.0
Regards
Hansjörg
|
|
|
|
|
How can we access SSAS cube data in a datagrid? If it is using adomd, can anyone please give the code.
Is there any .NET client application which will provide the same view as cube browser in SSAS cube project?
|
|
|
|
|
hi
i want to draw a shape (for example : line) in my form but i can't get result and nothing occured in my form and my code is :
private void Form1_Load(object sender, System.EventArgs e)
{
Graphics g = pe.Graphics;
Pen mypen = new Pen(System.Drawing.Color.Violet,2);
g.DrawLine(mypen,35,35,150,100);
}
and when i override OnPaint event of my form it is done and line create in my form.
my problem is that i can draw a shape only in OnPaint event and not i other events (for example : Form1_Load )
how to do that and how to draw shapes in picturebox..
please explain fully because i am beginner and i don't anything in web that explain fully.
thanks
|
|
|
|
|
This is what i have written in the click event of a button
Graphics g = pictureBox1.CreateGraphics();
Pen pe = new Pen(Color.Red,3);
g.DrawRectangle(pe,10,10,20,30);
This draws a rectangle on the pictureBox with the specified size.
Hope that is helpful
Regards,
Pramod
|
|
|
|
|
thanks you solved my problem
many thanks
|
|
|
|
|
Be careful when following the advise above, that's not really a clean solution!
First of all, you'll have to dispose of every Graphics object you create, otherwise you'll get a resource leak that can be very hard to debug.
Then the answer depends on what you want to do.
Do you want to draw into a Bitmap that's displayed in a PictureBox or do you want to show an Image in a PictureBox and draw something on this PictureBox (something like an overlay)?
In the first case, you'll have to use Graphics.FromImage() to get the Graphics object to draw on the Bitmap (don't forget to call Dispose() afterwards, or use the using() statement).
In the second case, the Paint event of the PictureBox is the only correct place to perform your painting. Everything else will be lost when the PictureBox is hidden (partially or full) and repainted.
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
Hi there fellow programmers!
I have a datagridview with say 20 rows, and I know that only ONE of them has a certain value in one of its cells. What I want to do is displaying this one row in top of the others, so it shows itself first.
There is no way i can set it first via sorting, and the FirstDisplayedScrollingRowIndex property doesnt seem to work unless Im doing something wrong - I'm setting in there the index of the row.
Any ideas? Thanks in advance
|
|
|
|
|
Hi
i been awak for two nights i can't see anything infront of me
BUT i must complete this
int [,,] myArray = new int [,,] {{1,2,3}};
it gives me the error
Incorrectly structured array initializer
WHY
--------------------------
If you found my answer to your question useful; then vote for me.
------------------------
Ahmad Shaban
|
|
|
|
|
|
Hi Stefan Troschütz
Thank you i found the error
object [,,] myArray;
myArray = new object [,,] { { {"@EngCode"},{SqlDbType.Int},{TxtCode.Text} } };
---------------------------------
I Have a stroed procedure that take 13 parameter
CREATE PROCEDURE dbo.CreateUser
(
@EngCode int,
@EngFName nvarchar(20),
@EngMName nvarchar(20),
@EngGName nvarchar(20),
@EngLName nvarchar(20),
@EngNotes nvarchar(500) ,
@EngineeerTypeID int,
@UserName nvarchar(10),
@EngMail nvarchar(50),
@EngCellNo int,
@EngHNo int,
@UserPassword nvarchar(12),
@UserNotes nvarchar(500)
)
I call this proc from my C# sO
SqlParameter POne = new SqlParameter();
POne.ParameterName = "@ParaName";
POne.Value = MyText.Text;
POne.SqlDbType = SqlDbType.NVarChar;
MyCommand.Parameters.Add ( Pone );
i will repeat this operation 13 time But
if i had a Multidimensional array
myArray = new object [,,] { { {"@EngCode"},{SqlDbType.Int},{TxtCode.Text} } };
and have a foreach to loop; it would be then a better idea
--------------------------
If you found my answer to your question useful; then vote for me.
------------------------
Ahmad Shaban
|
|
|
|
|
You can write those five lines of code in a single line:
MyCommand.Parameters.Add(new SqlParameter("@ParaName", SqlDbType.NVarChar)).Value = MyText.Text;
Notice that the Add method returns a reference to the parameter, so that you can set the value property.
---
b { font-weight: normal; }
|
|
|
|
|
Hi
Thank you very much
But we should put it that way
MyCommand.Parameters.Add(new SqlParameter("@ParaName", SqlDbType.NVarChar).Value = MyText.Text );
Thank You again
--------------------------
If you found my answer to your question useful; then vote for me.
------------------------
Ahmad Shaban
|
|
|
|
|
No, that doesn't work. The value of the operation or assigning the string to the Value property, is the string. The result is that you will be throwing the SqlParameter object away and adding the string to the parameter collection instead.
Use the method that I showed, or this even shorter one:
MyCommand.Parameters.Add("@ParaName", SqlDbType.NVarChar).Value = MyText.Text;
---
b { font-weight: normal; }
|
|
|
|
|
hi,
How can I import the data froma .csv file in SQl server database by DTS package in Dot Net C#.
Thank in advance
|
|
|
|
|
If i do that:
Image img_1 = new Bitmap(200, 200);
Image img_2;
img_2 = img_1;
now there are two different objects in the memory so if i do:
img_2 = null;
then
img_1 = 200x200 bitmap
or that is the same object so:
img_2 = null
then
img_1 = null too?
|
|
|
|
|
img_1 and img_2 are both refferenes to the object, and not the object itself.
If you do this:
Image img_1 = new Bitmap(200, 200);
Image img_2;
img_2 = img_1;
Then apply some manipulation to img_1, these changes will also reflect in img_2.
If you do this:
img_2 = null
Then it now points to nothing, but img_1 is still the value it once was (200x200 bmp).
And this:
img_2 = img_1
img_2 = new Bitmap(50,50)
img_1 will be the origional 200x200 bitmap, while img_2 will be the new 50x50 bitmap.
hope that helps
Tris
-- modified at 5:01 Tuesday 28th March, 2006
|
|
|
|