|
Add a boolean field to your class that is normally false.
In the Click event handlers for the items, check the boolean.
If it's false, set it to true and perform the processing, then set it back to false.
If it's true, do nothing.
|
|
|
|
|
For the handles, use the CLick method vice CHeckChanged?
|
|
|
|
|
|
Image img;
DataPhoto = new Byte[File.ContentLength];
img=Image.FromStream(DataPhoto);
the above code convert Byte to Image
my quastion how to convert image to Byte ???
Palestine
|
|
|
|
|
Create a MemoryStream object and use the Image.Save to save the image data to the MemoryStream. Then read the contents of the MemoryStream into a byte array by calling its ToArray method.
Paul
|
|
|
|
|
can u give me example ?
Palestine
|
|
|
|
|
MemoryStream ms = new MemoryStream();
img.Save(ms);
byte[] bytes = ms.ToArray();
|
|
|
|
|
If you close the MemoryStream as per the other user's example code, you might get the same GDI+ exception. Best is to use it in a 'using' construct.
|
|
|
|
|
please need example to know what u mean exactly ..
Palestine
|
|
|
|
|
Normally, CLR (Common Language Runtime) manages garbage collections. But in certain situation there is a need to release the resources used by the object(s) as soon as possible. For this purpose, using statement can be used.
According to MSDN:
The using statement allows the programmer to specify when objects that use resources should release them. The object provided to the using statement must implement the IDisposable interface. This interface provides the Dispose method, which should release the object's resources.<br />
<br />
A using statement can be exited either when the end of the using statement is reached or if an exception is thrown and control leaves the statement block before the end of the statement.<br />
For the examples, see msdn[^]
Regards.
________________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
i have this error
------
Array initializers can only be used in a variable or field initializer. Try using a new expression instead.
------
with this code
oEdit1.CustomButtons = new string[] {{"CustomName1","alert(\'Command 1 here.\')", "Caption 1 here", "btnCustom1.gif"},
{"CustomName2","alert(\\\"Command \'2\' here.\\\")","Caption 2 here","btnCustom2.gif"},
{"CustomName3","alert(\'Command \\\"3\\\" here.\')","Caption 3 here","btnCustom3.gif"}};
do u know how can solve this error
Palestine
|
|
|
|
|
Make that new string[][] { new string[] {"CustomName1","alert(\'Command 1 here.\')", "Caption 1 here", "btnCustom1.gif"}, new string[] {"CustomName2","alert(\\\"Command \'2\' here.\\\")"...
|
|
|
|
|
Hi
I have converted one project vs 2003 to vs2005.But I getting error like this
Exception Details: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
Date:<%=DateTime.Now%>I got that error in Include file.Just i want to know how to get DateTime Date:<%=DateTime.Now%> .
gmahi
|
|
|
|
|
Hi guys,
I am trying to import a function from a visual c++ dll which uses cstring. I keep getting an error saying object reference not set to an instance of an object. I believe it is because of cstring and have read a few posts which pretty much explain that it is not possible to get around this without writing a wrapper in c++. Unfortunately I have never written a wrapper script and hopefully you have a solution around this. Please help!!!
S
sasa
|
|
|
|
|
I replied a suggestion (just now) on your original thread. Try that, if it still fails, reply to this message, and I will see if I can help with that wrapper
|
|
|
|
|
Hi leppie, What do you mean by original thread, this is the only thread I have.
Please respond to this.
Thanks
S
sasa
|
|
|
|
|
|
Thank you for your response. I get the error saying Methods type signature is not pinvoke compatible. Any ideas?
S
sasa
|
|
|
|
|
hi,
How do I add numbers in a listBox?
eg. I have a list of numbers in my listbox and I want to add them and place the result in a textBox.
|
|
|
|
|
Use a variable to maintain a running sum. Iterate through each item in the listbox. For each iteration, convert the value of the current item to a number and add its value to the current value of the running sum variable. Finally, write the value of the running sum variable to your textbox.
Paul
|
|
|
|
|
Here is the code if you require
int sum =0;
for(int i=0;i
|
|
|
|
|
What is the difference between dispose() and finalize()methods in c#?
|
|
|
|
|
Dineshraj wrote: dispose() and finalize()methods in c#?
Dispose() is an implementation of the IDisposable interface. It is used to clean up unmanaged resources from an object when it is no longer needed. You explicitly call the Dispose method.
The Finalize method (using the destructor syntax in C#) is called when the Garbage collector cleans up the object. It should not be created unless needed as it slows garbage collection. If it is needed it most likely will call the Dispose method (so that all your clean up code is in one place). You have no control over when the finaliser is called.
|
|
|
|
|
Does this mean that explicity creating a destructor, say:
~MyClass()
{
...
}
is just a different way of writing:
protected override void Finalize()
{
...
}
?
"It was the day before today.... I remember it like it was yesterday."
-Moleman
|
|
|
|
|
The ~ syntax will implicitly call the finalizer.
Deja View - the feeling that you've seen this post before.
|
|
|
|