|
I guess you need to check if the name is already in the list, and if so, append a number to the name. In that instance, I am assuming you need to add the FilterInfo to the combo box, and set the DisplayMember to be the Name property, otherwise, how do you tell which is which, if not by name ?
Christian Graus
Driven to the arms of OSX by Vista.
Please read this[ ^] if you don't like the answer I gave to your question.
|
|
|
|
|
|
What you could do is check the documentation and watch for some OpenFileDialog Properties; I bet some of them even have "Directory" in their name.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Collin Jasnoch wrote: What documentation?
You are using OpenFileDialog and having some trouble with it, hence read its documentation. It is all in there, Google if you don't know where to find it, then read the page and learn.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Yeah, you confused me there. If you are not using OpenFileDialog, then read up on the documentation of the code you are using or contact its provider. Chances are they intended to mimick OpenFileDialog though.
When a relative path (or just a file name) is specified, .NET (and Windows) will rely on the "Current Directory" which by default starts out to be the folder holding your EXE file; however there are many ways to change it on the go (and even at app start), so it is not a recommended way of doing things.
Better set things explicitly; also have a look at the "special folders", see Environment.GetFolderPath()
with SpecialFolder.ApplicationData and CommonApplicationData (you should use a folder hierarchy in there, based on your company name and/or product name).
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Collin Jasnoch wrote: Bitmap bmp = new Bitmap(img); will not work if img is an absolute path.
Then something is wrong with your path. Did you confuse forward and backward slashes? are you referring to a case-sensitive file system (as in UNIX/Linux)? Did you forget a slash between path and name? Did you make a mistake in escaping a backslash?
Don't go the CD way if you don't have to, fix the real problem instead.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Hi, I need to change the BIOS configuration from c#, to enable or disable a Network Adapter.
Thanks
|
|
|
|
|
I have seen lots of articles/blogs on reading BIOS settings. I'm not sure that writing them is possible, could be, but I'm not sure.
In any event, would that be the right place for Network Adapter configuration?
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks, but I need to write the BIOS to enable LAN.
|
|
|
|
|
After your first post, I did a little googling, and found this article[^]. It seems that you can treat the CMOS like ports 70 and 71, I assume one for reading and one for writing, though I could well be wrong on that.
Hope that it at least gives you some clues on how to proceed.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
I don't know if this will help you, but take a look at this[^]. Click the first link to download the code.
It's got to be better than messing with the BIOS, one slip and you've got a doorstop.
Henry Minute
Do not read medical books! You could die of a misprint. - Mark Twain
Girl: (staring) "Why do you need an icy cucumber?"
“I want to report a fraud. The government is lying to us all.”
|
|
|
|
|
Thanks, but this code works if the network is enabled in the BIOS and doesn't work on Windows Vista. I need on Vista and XP.
|
|
|
|
|
Is there a way for a custom control on a form to tell if it's being called in design mode.
I tried using the DesignMode member in the constructor, but if the control is on a form in the designer DesignMode has a value of false.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
TopLevelControl.DesignMode?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
TopLevelControl doesn't have a DesignMode property.
Google's turned up a few fugly hacks, but there doesn't seem to be any supported way to check this from within the constructor itself.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Sorry, I didn't realize DesignMode is protected, not public.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
I found that after posting, it pukes if you're using something other than visual studio (eg sharpdevelop), and while I us MSVS and this is an internal app, I dislike that sort of thing on general principles.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Ok. How about checking EntryAssembly == YourApp?
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
Wouldn't that cause it to fail if I renamed the app/used the control for a second app in the future?
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
You could test against Application.ExecutablePath.
This is getting complicated = would need some testing
Nick
----------------------------------
Be excellent to each other
|
|
|
|
|
no, this is getting complicated = add comment about MS stupidity and move code out of constructor.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|