|
If the event handler is in another thread, then no, it doesn't.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Yes and no. Don't they all start out on the GUI thread and if he chooses he can spin off threads to do other stuff? But the messages all come into the pump in order and the events fire in order, yes?
I don't see how things would happen out of order unless he did something he didn't mean to do.
As with your other response; why spin off a thread if you don't want asynchronous processing?
At any rate, I don't understand the question.
|
|
|
|
|
You could suspend the thread at the beginning of the event handler, and continue the thread at the end of the handler. But if you do that, you've essentially eliminated the benefit of using multithreading.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
is it possible to use XML file as data source for Microsoft Reports Viewer? How?
|
|
|
|
|
Creating Data Sources for a Report[^]
"Default data processing extensions are available for SQL Server, Analysis Services, SQL Server Integration Services, Oracle, SAP NetWeaver® Business Intelligence, XML, ODBC, and OLE DB."
Seriously, learning to use a search engine will help you a great deal
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
I want to know how can I associate a file extension with my application? and when it's associated in Windows how can I make the file with that clickable so when the user clicks it then my application receives it? do I have to pass as arguments?!
|
|
|
|
|
Are you in China? Is Google restricted for you?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
hahaha.. nice
i already did google but i can only fine associating file during deployment and what i want is to have it part of my application in the Options form?
|
|
|
|
|
|
Is there any way to create a folder like My Pictures and My Music and My Data Sources in My Documents, I mean to have that folder has a special icon not the normal yellow folder icon?
|
|
|
|
|
To create the directory, get the My Documents path using Environment.GetFolderPath then create the directory. Like this,
Directory.CreateDirectory(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "Test Directory"));
The appearance of the folder is determined by the desktop.ini[^] file.
Eslam Afifi
|
|
|
|
|
I have MDI application and many MDI children openned. If user changed data in textboxes in many MDI then how can I detect is_changed and how to save the data of every MDI children before closing the application?
|
|
|
|
|
Each child should understand and monitor what state it is in. If you handle the Closing event for each child window, then each can determine if the data should be saved before closing.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Your data model has to expose a property that is set to some value (using a Boolean) to indicate whether the data is "dirty" or not an needs to be saved. The MDI forms should have nothing to do with it at all. When a property in the data model is changed (you ARE using a seperate class to store your data, right?), the property code can just set the flag to "dirty".
|
|
|
|
|
Hi all,
I've used the default .NET serialization for a class with a System.Drawing.Color member. The code is now in use by people, and I need to add an extra member to the class, but still deserialize older versions.
It uses the SoapFormatter, so can't use the [OptionalField] attribute.
So I added ISerializable to the class, which instantly caused a much bigger problem: Structs (like System.Drawing.Color) suddenly can no longer be deserialized; I get the exception message, "Top Object cannot be instantiated for element 'foreColor'".
Does anyone know how I can get the SoapFormatter to read both old and new versions, and still handle structs?
Thanks!
Alan
|
|
|
|
|
Maybe following design could help:
Create a new class by extending your previous class, i.e.
public class MyNewClass : MyOldClass
Then add a Version property to the (new) class.
For deserialization, get that property with
XmlNode versionNode = xmlDoc.SelectSingleNode("/MyNewClass/Version");
If versionNode is null, call the deserialization method of MyOldClass, otherwise use the deserialization method of MyNewClass. With the version property, you will then be able to extend further easily.
|
|
|
|
|
I have an image that's been resized to 640x480 pixels. I want to add 'blank space' (white background) to the top of the image. I want to add 70 pixels to the height, so that I have the original image plus a blank 70 pixel high space at the top.
Anyone know how to do this?
Paul
|
|
|
|
|
MS Paint?
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Answered my own question: The following will return your image with a 'white' bar 70 pixels high at the top.
public Bitmap AddLabelSpace(ref Bitmap img)
{
var ret = new Bitmap(img.Width, img.Height + 70);
var g = Graphics.FromImage(ret);
g.Clear(Color.White);
g.DrawImage(img, 0, 71,imgr.Width,imgr.Height);
ret.Save("f:\\test.jpg",ImageFormat.Jpeg);
return ret;
}
|
|
|
|
|
That is the right way to do it, except for the 71; should be 70, your code is dropping the bottom row of pixels!
|
|
|
|
|
I was about to say that
It is Good to be Important but!
it is more Important to be Good
|
|
|
|
|
I thought I was in the asp forum when I answered before, ignore it if it's still there.
Create a new image in MSPaint of 640 X 550. Then go 'Paste From' and grab the image and move it to the bottom and Save.
That should do it.
me, me, me
"The dinosaurs became extinct because they didn't have a space program. And if we become extinct because we don't have a space program, it'll serve us right!"
Larry Niven
|
|
|
|
|
Hey guys
I know how to add an item to windows context menu but how do I reference that file that I right clicked on in my c#/vb app?
Thanks
|
|
|
|
|
Once you have associated a specific file extension with your app, double-clicking such file in Windows Explorer will launch your app and pass the file (or the selected files) as command line arguments. So look either into the parameters of your static Main() method, or, easier, use some of the Environment methods (GetCommandLineArgs).
|
|
|
|
|
Thanks for the fast response. It helped me a lot
|
|
|
|