|
Ian Uy wrote: Just think of it as a "programming exercise" given in school and you have to type a random path and tell if it is a file and a folder.
Your teacher is a retard. If the file doesn't really exist, and you can't use the presence of extensions to tell, then there is no real solution.
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 )
|
|
|
|
|
No, its not a school activity. I just made that up to simplify the matter.
Well, this is the real scenario...
I have a function that "ROLLBACKS" files and folders. I have a special routine for files and special routine for folders. Those files and folders does not exist yet, that's why I can't use the .Exists() method.
I just want a function that accepts a PATH and returns if it is a folder or file.
Sorry for the confusion.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
Ian Uy wrote: I just want a function that accepts a PATH and returns if it is a folder or file.
Not possible, for the reasons stated. Your best bet is to assume an extension means it's a file.
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 for your time Mr. Graus.
It is said that the most complex structures built by mankind are software systems. This is not generally appreciated because most people cannot see them. Maybe that's a good thing because if we saw them as buildings, we'd deem many of them unsafe.
|
|
|
|
|
As has been pointed out, there is no way to tell if a path is for a directory or file UNLESS there is a directory delimiter (slash) at the end. This isn't guaranteed by almost any function, though.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hello,
I have a main form that contains many form. When i am trying to close the main form by the X control box button, the onformclosing event of the child forms are launched before the main form event (onclosing) are launched.
How can i capte the X button closing in the mainform first?
best regards,
dghdfghdfghdfghdgh
|
|
|
|
|
The main form is closing it's children first. This is logical. I am not sure if you can do anything about it.
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 can check the FormClosingEventArgs in FormClosing. Allows you to cancel closing the form. I don't really know if the child forms will stay open, but it sounds logical that they will.
www.andrewvos.com
|
|
|
|
|
I have an application which generates a sine wave. when i move horizontal bar the waveform is again painting on the panel.. do to this, there is lot of flickering in the waveform..
plz do help me..
|
|
|
|
|
You can turn on double buffering,
this.SetStyle(
ControlStyles.AllPaintingInWmPaint |
ControlStyles.UserPaint |
ControlStyles.DoubleBuffer,true);
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 )
|
|
|
|
|
I used the above code Flickering is not completely removed, still its slightly fliickering. Is there any way to Remove complete flickering of Waveform.
Whenever the form is resized or the horizontal scrollbar is moved, the waveform starts flickering.. plz do help me..
|
|
|
|
|
I create a winform by c# 2003. The form's classname like "windows.forms.app3",I must change the it to the particular name that like "myForm". Thanks for you help.
|
|
|
|
|
If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
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 )
|
|
|
|
|
Sorry, maybe my question is not clear. The classname is not my class name. use the tools SPY++, you can find the form's classname is "windows.forms.app3". i want change it.
|
|
|
|
|
well, why on earth would you want to do that ? I doubt you can.
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 )
|
|
|
|
|
My winform is controled by other software. It use windows api function "sendmessage" send the windows message to my form. The function need 2 parms "form's classname & form's title".
so i must change the classname to specific name like "myForm".
|
|
|
|
|
No, you don't need to do that. SendMessage takes a HWND, you can FIND the hwnd based on name or title, using different APIs.
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 )
|
|
|
|
|
Christian Graus wrote: If you use F2 to rename the file in the solution Explorer, I think it will rename the class for you. Yo ucan also right click on the name and rename it via the refactor menu. Finally, you can just do a global search and replace.
Only works on a "modern" IDE. VS 2003 didn't have the fancy refactoring - this was introduced in 2005.
|
|
|
|
|
Which is why I also said 'search and replace' :p
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 )
|
|
|
|
|
Override CreateParams, and set the class name yourself. Not sure if it will give you an exact name though, but it's worth a try.
www.andrewvos.com
|
|
|
|
|
Hmm. Doesn't work.
www.andrewvos.com
|
|
|
|
|
Thanks.
That is no answer
|
|
|
|
|
If you want to use SendMessage to send something to a window, do what was mentioned above.
Maybe inherit a NativeWindow, and set the caption to something like "My Special Window". Then you can use FindWindow("My Special Window") to find the handle of the window you want to SendMessage to. All you need to do then is override WndProc in the NativeWindow.
Have a look at FindWindow on pinvoke.net.
www.andrewvos.com
|
|
|
|
|
private void AutoComplete_DGV_EditingControlShowing(object sender,DataGridViewEditingControlShowingEventArgs e)
{
TextBox textBx = e.Control as TextBox;
if (textBx != null && /*
* Only if the column index of the current cell is
* "The one for which we need autocomplete functionality"
*/
((DataGridView)sender).CurrentCell.ColumnIndex == 1)
{
/*
* "BackGround COLORING" :
* Cleaning the existing EventHandlers
*/
textBx.TextChanged -=
new EventHandler(AutoComplete_OnSelectionSetBackColor);/*
* "BackGround COLORING" :
* Adding new event handler.
*/
textBx.TextChanged +=
new EventHandler(AutoComplete_OnSelectionSetBackColor);
//Populating the 'custom datasource' values.
textBx.AutoCompleteCustomSource.AddRange(new string[ {
"valuea","valueab","valueabc",
"x","xyz","xyz123",
"a12","a123","a123def",
"d","def","defg"});
//Setting to Suggest mode.
textBx.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.Suggest;
//Setting the source to the above created custom suggest datasource.
textBx.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.CustomSource;
}
else if (textBx != null /*if the column index of the current cell NOT "The one for which we need autocomplete functionality"
* Resetting the edited control's Autocomplete flags
*/)
{
/* "BackGround COLORING" :
* Cleaning the existing EventHandlers
*/
textBx.TextChanged -=
new EventHandler(AutoComplete_OnSelectionSetBackColor);/* Note: The following code ensures that if the column which is being edited.
* is NOT "THE AUTOCOMPLETE ONE" then is undo the effects for the Autocomplete edit settings
*/
textBx.AutoCompleteCustomSource.Clear();
textBx.AutoCompleteMode = System.Windows.Forms.AutoCompleteMode.None;textBx.AutoCompleteSource = System.Windows.Forms.AutoCompleteSource.None;
}
}
Can we do same with InfragisticsGridControl[ultraGrid1]...
Please provide me code...
Thanks...
modified on Tuesday, June 10, 2008 9:04 AM
|
|
|
|
|
3rd party specific questions should be asked on the appropriate site - in this case Infragistics. You are more likely to get help there - provided you have a legitimate version of the controls.
|
|
|
|