|
Hi guys,
Please help! I am trying to show an animated gif on button click. in my click event I have a while loop and until the while loop condition is met I would like to show an animated gif to inform the user that the application is searching...
I have tried different methods, threads, a new form with the picturebox and image and all of them show the image but the transition/rotation of the image is not smooth. Please help on how to go about this.
Thank you in advance
Sameer
|
|
|
|
|
Sounds like your search needs to go into another thread, so that the gif code can run smoothly.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian for your response. Can you please give me an example or something, I am quite new to threading. Thanks in advance.
Sameer
|
|
|
|
|
BackgroundWorker[^] is the class I use for threading.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you Christian. I will give this a shot.
Sameer
|
|
|
|
|
Have you already tried to use the ImageAnimator class?
|
|
|
|
|
no I haven't, it required me to change quite a bit of my code so I have left it for now. I wish there was an easier solution
Sameer
|
|
|
|
|
I have an application which is launched to run as different user than logged in user.
When user start shutdown/restrat/loggoff I don't receive WM_QUERYENDSESSION. I tried running the same process with logged in user and it works fine.
When it is running as different user, it doesn't even receive FormClosing. I think its directly killed.
How do I resolve this problem? Please help.
Thanks in advance
Shanti
|
|
|
|
|
I'm making a class called MMap (Modifiable Map), it's similar to System.Collections.Generic.Dictionary, except you can modify the value of the given key. What I want to do is make sure that typeparam K is always a nullable type, IE not primitives like int or char. I know I have to do something like this:
public class MMap[K, V] where K : foo<br />
{<br />
<br />
}
but I'm not sure what to put where foo is. I'm using .Net 2.0 (I know the [] should be less than and greater than)
Thanks.
|
|
|
|
|
Something like this can make a similar behavior:
public class MMap< K,V > where K:struct
{
public void Add(Nullable < K > key,V value)
{
}
}
|
|
|
|
|
hspc wrote: where K:struct
where K:class
|
|
|
|
|
PIEBALDconsult wrote: where K:class
This will cause a compilation error, Nullable accepts structs only.
|
|
|
|
|
"
a nullable type, IE not primitives like int or char
"
and he said "nullable", not "Nullable".
|
|
|
|
|
|
I've create a setup project with c#.NET 2008 and i need to run a bat file after the installation is completed. So, how to set my setup project to run bat file after installation?
thank
a
|
|
|
|
|
how are you creating your setup project ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
You cannot run a bat file after installation, only installer classes or scripts.
The keyword here is "custom actions", if you google for this you'll find lots of information.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
What is the easiest way to serialize an array of objects like the one in the following code example?
public void Test()
{
List<object> arObject = new List<object>();
arObject.Add(Color.Red);
arObject.Add(Color.Green);
arObject.Add(new string("Hello World!"));
arObject.Add(new MyObject());
}</object></object>
In my program the object array represents an array of property values which could be of any time. Custom objects implement the IXmlSerializable interface, and simple types like strings appear to work fine. So far I have found problems with the low-level types like System.Drawing.Color and the like. Is there a generic way of serializing objects which do not implement the IXmlSerializable interface?
At the moment I am not using the XmlSerializer class because I need extra control over how objects are serialized. So instead I am just using the XmlWriter class.
Any help would be greatly appreciated!
Lea Hayes
|
|
|
|
|
Hi!
Does it have to be XML? Otherwise the BinaryFormatter is a very easily to use alternative.
Or use the SoapFormatter (although I think it has a problem with generics IIRC).
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi,
Unfortunately the BinaryFormatter will not do the trick because it is not easily edited by the user. I keep seeing SoapFormatter pop up here and there, I've not actually use this before so I think it is time to dig into some MSDN documentation and the brilliant selection of articles on CodeProject!
Thanks for your advice!
Lea Hayes
|
|
|
|
|
Hi!
Yes, the binary files created by BinaryFormatter cannot be edited easily by the user, but it's also a way to protect the integrity of your serialized data.
When users can play around, they will and then you'll have to deal with invalid XML files...
So depending on what you want the user to edit, creating a separate function to modify the serialized data could be a safer option.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hi
Can anyone help for me the following issue?
I have a windows form with Gridview control and other server controls.while form load i'm filling the Gridview control. but i dont want the Rowchanged event to be fired.
what i need to do to solve the above issue?
Thanks in advance
regards
sri
|
|
|
|
|
how could i affect a cell value based on other one in a datagrid?
I have a simple textbox in which the user can insert value, so i need when i leave the textbox run a specific function
i already created this code :
GridColumn = new DataGridTextBoxColumn();
GridColumn.MappingName="Row_Percentage";
GridColumn.Width=100;
GridColumn.HeaderText="Row_Percentage";
GridColumn.TextBox.Leave +=new EventHandler(GridColumn_Leave);
GridTableStyle.GridColumnStyles.Add(GridColumn);
the problem is i couldn't take the value of the current cell untill i leave the column not the "cell"!!
please if someone could help
|
|
|
|
|
Hi,
I have a PC with Multi IP address.
I would like to navigate with the WebBrowser to a URL but with the IP of my choice.
I tried a few things but nothing worked.
Any Ideas?
Thanks in advance.
-fEINT
|
|
|
|
|
browser.Navigate(theIpAddress) ?
|
|
|
|