|
|
I want to retrieve the icon used to represent a removable or local hard disk.
I know I can use SHGetFileInfo to get the icon if the disk exists, but what if the disk doesn't?
Basically I want to create a tree structure representing a device that has a removable disk and a local disk. These devices will exist on a virtual device that I am representing.
Is there a way to retrieve an icon for a Device that doesn't exist? i.e. can I specify something that denotes to SHGetFileInfo that I want a device's icon for a device's type that I specify?
.............................
There's nothing like the sound of incoming rifle and mortar rounds to cure the blues. No matter how down you are, you take an active and immediate interest in life.
Fiat justitia, et ruat cælum
|
|
|
|
|
Hi,
I'm calling a web service from my app and its execution lasts a few minutes, normally. I would like to leave it executing without making my app wait until it finishes. How can I do this? Some type of thread or something?
Thanx for any help!
|
|
|
|
|
Here's a simple snipet:
using System.Threading;
...
public void myProc( object stateobject )
{
MessageBox.Show( "This is a thread." );
}
private void button1_Click(object sender, System.EventArgs e)
{
ThreadPool.QueueUserWorkItem( new WaitCallback( myProc ) );
}
|
|
|
|
|
Thank you!
|
|
|
|
|
Hi.
I like PieDoes anyone know of any cheap, or free VC# skinning programs?
Thanks
Hengy
I like Pie
|
|
|
|
|
Hey.
Can anyone help me with this.
I have an object, that can grow bigger or smaller.
I need to save it in a file after I encrypt it.
The problem -> How can I clear the file before saving new stuff in it? if I won't clear it, it will write in the start 1 object, then I will have the same object PLUS the new object, then I will have the 2 last object PLUS the new one.... etc...
So... How can I do it?
Thanks...
NaNg.
|
|
|
|
|
Well the FileStream constructor goes like this:
FileStream( string path,FileMode mode );
Now, FileMode is an enum with member names:
Append, Create, CreateNew, Open, OpenOrCreate and Truncate.
If you use FileMode.Create it will overwrite the old file or create a new one if the file doesn't exist.
Hope this helps.
|
|
|
|
|
|
Hi!
I'vw been having some odd problems with connecting elements in Dundas diagram. I have an Element with 3 ConnectionPoints ( on is an input, and two ara outputs ) and when I try to connect a second Element's input to one of the outputs it always connects to the same ConnectionPoint no mater which I specify in the code. Like:
ElementFunctionality.ConnectElements( myConnector , TheOtherPoint , myElement.ConnectionPoints[ "Yes" ] );
//and
ElementFunctionality.ConnectElements( myConnector , TheOtherPoint , myElement.ConnectionPoints[ "No" ] );
will both connect to the "Yes" ConnectionPoint of the elment. I've even tried connecting manualy without using the ConnectElements function. I'm realy out of ideas.
Can someone help? Oh, and here is a screenshot.
|
|
|
|
|
Try support@dundas.com
Regards,
Nish
|
|
|
|
|
Hi
I have been trying to get my code working for days now, but I have run out of ideas of what could be wrong.
My problem is that I have a program where I want to save a file path from an openfiledialog into a XML document. It sounds pretty simple, but I keep getting an XML error, saying that my XML file does not exist :-S Even though it is the correct path.
I was wondering if anyone had a piece of code, which does the above-mentioned? That way I may be able to find a solution to my problem.
//Nick
|
|
|
|
|
It would help if you posted a code fragment.
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
public class ClassFunctions : FormMain
{
private string strXMLLocation = @"..\..\WallpaperDatabase.xml";
public string fxGetFileName()
{
string strFileName = "";
this.openFileDialog1.Multiselect = false;
this.openFileDialog1.ShowDialog();
if (File.Exists(openFileDialog1.FileName))
{
strFileName = openFileDialog1.FileName;
}
return strFileName;
}
public string fxGetString()
{
string strFileName = "";
this.openFileDialog1.Multiselect = false;
this.openFileDialog1.ShowDialog();
if(File.Exists(openFileDialog1.FileName))
{
strFileName = this.openFileDialog1.FileName.ToString();
}
this.openFileDialog1.Dispose();
return strFileName;
}
public void fxAddPicture()
{
string strFilePath = fxGetFileName();
string insertXML;
XmlDocument xdoc = null;
XmlTextReader xreader = null;
XmlDocumentFragment xdocFrag = null;
try
{
xdoc = new XmlDocument();
xreader = new XmlTextReader(strXMLLocation);
xreader.Read();
xdoc.Load(xreader);
xreader.Close();
insertXML = "<Wallpaper><FileName>" + "test" + "</FileName><FilePath>" + strFilePath + "</FilePath></Wallpaper>";
xdocFrag = xdoc.CreateDocumentFragment();
xdocFrag.InnerXml = insertXML;
xdoc.DocumentElement.AppendChild(xdocFrag);
xdoc.Save(strXMLLocation);
}
catch (Exception ex)
{
MessageBox.Show(ex.ToString());
}
}
}
Here are the two functions within my class which are supposed to do the job J
//Nick
|
|
|
|
|
Perhaps you should try
private string strXMLLocation = Application.StartupPath + @"..\..\WallpaperDatabase.xml";
|
|
|
|
|
Adis H. wrote: Perhaps you should try
private string strXMLLocation = Application.StartupPath + @"..\..\WallpaperDatabase.xml";
When i try that i get the following error:
The syntax in the filename, the folder or the disk unit is incorrect.
but the XML file does exist.
|
|
|
|
|
Sorry make that:
private string strXMLLocation = Application.StartupPath + @"\..\..\WallpaperDatabase.xml";
You see the StartupPath returns a path like C:\blah_blah\App_Folder
without the "\" at the end, so you need to add it.
|
|
|
|
|
Thanks a lot it is working just fine now
|
|
|
|
|
I have a "List<CSomeObject> someList" with several properties. When I assign my "dataGridView.DataSource = someList" it populates the DataGridView, but the order of the properties is seemingly random. Can I specify the order somehow? Also, can I change the name of the columns instead of being forced to use the Property name?
-- modified at 15:45 Monday 12th June, 2006
|
|
|
|
|
You can create your own columns for the DataGridView by setting its AutoGenerateColumns property to false and then adding DataGridViewColumn-derived (e.g. DataGridViewTextBoxColumn ) columns to it with your desired HeaderText and DataPropertyName properties, in the order you want, preferably prior to data binding.
--
I've killed again, haven't I?
|
|
|
|
|
How do I call a different application from the one I am running on a CE.net device in C#. It appears that the Process class is not supported in the CF.
|
|
|
|
|
|
|
Use Mockup Studio.Net!
- It's easier to make than to correct a mistake.
|
|
|
|
|
Hello,
I have a MDI child form full of controls (mainly text boxes), which save their values to the underlying object on the Validated event. My problem is that the Validated event is not raised when the user clicks on a toolstrip button, since apparently the text box never loses focus.
I had this same problem in .NET 1.x with the Toolbar control, but it was easy to solve since no matter the button, the save event was raised: ButtonClicked . There I could force the Validated event (by setting focus to the toolbar and back to the control) and then proceed to do whatever the button was supposed to do.
The problem is that with the ToolStrip control every button raises its own event, and thus I would have to force the event in every handler of every window, and for obvious reasons I don't want to. I have serached but I have not found a ButtonClick or similar event in the ToolStrip control.
So, does anyone have an idea of an easy way to solve this?
[EDIT: I just found out the CausedValidation property on the ToolStrip , but after trying it it still doesn't work.]
[EDIT AGAIN: I had tried the ItemClicked event and it didn't seem to work, but now I know why: I was handling it on the ToolStrip on the MDI child (which is merged to a ToolStrip in the parent form). Now that I handled it in the parent window, it works. The problem here is I can't stop the raising of the Click event for the toolstrip item if validation fails].
Thanks in advance,
Luis Alonso Ramos
Intelectix
Chihuahua, Mexico Not much here: My CP Blog!
-- modified at 15:17 Monday 12th June, 2006
|
|
|
|