|
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
|
|
|
|
|
You're welcome.
|
|
|
|
|
Blikkies wrote: I know how to add an item to windows context menu
Hey Blikkies
Regarding above quote, would you be able to point me into the right direction to accomplish this? I am trying to formulate some code in order to "archive" files by simply moving and renaming them from one folder into another via user interface (that would be my app executed through the windows context menu).
The whole thing is thus mainly depending on the integration into the windows context menu (and the outlook 2007 menu, but I'm trying a few things already for that one). Would be deeply appreciated if you could help.
Thanks & regards
Firl
|
|
|
|
|
I need to create a speaker verification software in c#.Is there any API like SAPI to do this? i googled for a while and i only get licenced DLL(800$). is there any article written about speaker verification in .net
|
|
|
|
|
Play a WAVE file that says, "if you can hear this, press RETURN".
|
|
|
|
|
is zat suppose 2 be a jok or wat? if u dont know wat 2 say plz dont say nothin at all
|
|
|
|
|