|
If your GUI is truely idle, then you wouldn;t have to call DoEvents at all. But if you're GUI is doing something, like blocking while your waiting for a thread to complete, then DoEvents can do strange things. It sounds like you haven't done something correctly, but without further information and code samples, it's impossible to tell you what that is.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I HAVE A SIMILAR PROBLEM
i am havig a list view and i dynamically tried to cange the cursor to waiting cursor, but it does not work.
then i tried changing the cursor from the property of the list view but it does not work either.
|
|
|
|
|
Are you sure the event is on the GUI thread? You might want to check using InvokeRequired property; if an invoke is required, that would explain why the cursor setting doesn't seem to be working.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: He has a funny face. And he's my son.
Judah Himango
|
|
|
|
|
I HAVE A SIMILAR PROBLEM
i am havig a list view and i dynamically tried to cange the cursor to waiting cursor, but it does not work.
then i tried changing the cursor from the property of the list view but it does not work either.
|
|
|
|
|
Hi...
I have a richtextbox and the ReadOnly is set to true... but if the richtextbox is focused and I press this char '€'(it is on the 'e' key on my keyboard) on the keyboard, it is being showed in the richtextbox?!?
can anyone tell me how that char, and no other chars are being showed?
and if it is possible to do so the char is not being showed!!
thanks
QzRz
QzRz
|
|
|
|
|
Interesting. On my machine that doesnt happen
Try to handle the KeyDown event of the textbox and alter the event arguments:
private void richTextBox1_KeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
{
e.Handled = true;
}
|
|
|
|
|
that did it...!
But can you tell me what the "e.Handled = true" event do...?
Thanks alot...!
QzRz
|
|
|
|
|
Its relatively simple:
The KeyDown events tells the consumer of the event that a key is being pressed. This event is raised before the underlying control actually reacts on the key. If you set e.Handled to true this will tell the control not to react at all (its nearly as the key would never have been pressed).
|
|
|
|
|
okay... that is really simple...!
thanks!
QzRz
|
|
|
|
|
Hi there,
Trying to make my application write to the system event viewer without success so far. Does anyone know how to go about this....?
appriciate all help
regards,
Boris.
|
|
|
|
|
|
The simplest way:
EventLog.WriteEntry("My App"," there is an error occured on bla bla ...");
Does it help ??
------------------------------------
To study, study and only to study
|
|
|
|
|
Hi,
I want to get all of my inbox messages in to my application using C#. If their is any code snippet you have please share it.
Help kindly appreciated.
The Phantom.
|
|
|
|
|
Just as a hint:
Before posting here at least search Google and the article base here on CodeProject.
Now to the answer:
This article should contain all you need.
|
|
|
|
|
Hi,
My requirement is to do a file copy (upload) from my machine to a remote machine (Mapped Drive) both windows and at the same time I want the file copying logic should completely reside on my machine, I donot require peer2peer.
Is their any way to do that, help kindly appreciated.
The Phantom.
|
|
|
|
|
You can use two FileStream s. One for reading from the source file and the second for writing to the mapped drive.
Have a look at System.IO.File.OpenRead and System.IO.File.Create for getting the streams.
|
|
|
|
|
I am trying to input \n\n in my query while running an INSERT query, but MS Access if not allowing me to do so, at the same time it doesn't allow me to pass single quote into the query.
Any body know how to resolve it and how to deal with this kind of situation.
The Phantom.
|
|
|
|
|
Hi,
I have five textboxes, where each of them defined as txtControl1 to txtControl5.
Now I am running a loop to populate these textboxes with some text like this
for (i=1; i<6; i++)
{
txtControl+i.Text = "Hello World" ;
}
Now when I am compiling, I am getting error "unable to find txtControl", with error message its clear the above line is unable to contact the control with the value of i.
Is anyone know how to do that
The Phantom.
|
|
|
|
|
This kind of loop can only be made if you store your textboxes previously in an ArrayList or normal array:
private TextBox[] myTextBoxes;
myTextBoxes = new TextBox[] { txtControl1, txtControl2, txtControl3, txtControl4, txtControl5, txtControl6 };
for (i=1; i<6; i++)
{
myTextBoxes[i].Text = "Hello World" ;
}
|
|
|
|
|
You will not be able to convert i (which is int variable) to first a string variable, and then a string variable to a textbox.
Better way to do so is to declare an ArrayList (say called arrayTextBoxes).
Then, initialize this ArrayList in the constructor of the form on which the textboxes are placed. You can declare the initial capacity of this ArrayList (which defaults to 16).
Thereafter, (in the constructor of the form itself) populate the ArrayList with the instances of the 5 textboxes being used by you, by using the Add or AddRange method.
Now you are ready to use the members (i.e., the textboxes)of the ArrayList in your code as, for example,-
for (i=0; i<5; i++)
{
//here the arrayList is 0-based, so use i = 0 onwards
((TextBox) arrayTextBoxes[i]).Text = "Hello World" ;
//arrayTextBoxes is the aforesaid ArrayList instance
}
In the aforesaid example, arrayTextBoxes[0] will represent the textbox1, and so on.
|
|
|
|
|
How can I know the installed SAPI version (4.0, 5.0, 5.1) on my compouter?
egyseiko
egyseiko
|
|
|
|
|
I need to make a two dimension array in my C# program, if I use ArrayList it would take ages to just assign a simple value to each cell. If I use System.Array the disk would run out of memory and the computer might hang. The size of array I'm using is about 10000 X 10000. What do I do?
Thank you
|
|
|
|
|
This greatly depends on what you want to do with this array.
In one of my projects (where I also had several large 2 dimensional arrays) I write those directly to disk. Because I write the files byte by byte by myself I can randomly access the matrix directly in the file (by using the FileStream.Position property). With some intelligent caching mechanism you can even make this being fast .
More general you should be think about what really needs to be in your array. Are you storing double or decimals? Probably floats or integers are sufficient.
For more detailed hints you would have to describe what kind of data you are having in your arrays and what you want to do with it.
|
|
|
|
|
Hi!
I'm looking for a way to maintain the scrolling ability of a listView during
a drag&drop operation (necessary if the screen is too small to display all
the items of the lv), pretty much like the Windows Explorer does it - when
you hit the upper edge of the window it scrolls upwards.
By the way the AutoScroll property of my ListView is set to true.
Thanks already in advance!
|
|
|
|
|
I declared private variables
DataSet ds=new DataSet();
SqlConnection cn=new SqlConnection();
and i load one table from sql server set to datagrid datasource.and memory usage is increasing and i call dispose method to deallocate object.but memory usage is still remaining.
i dispose like that..cn.dispose(),ds.dispose().
how can i fix it?
|
|
|
|