Click here to Skip to main content
15,903,362 members
Home / Discussions / C#
   

C#

 
GeneralRe: Array of Interfaces Pin
Member 26118827-Feb-04 2:42
Member 26118827-Feb-04 2:42 
GeneralRe: Array of Interfaces Pin
Heath Stewart27-Feb-04 3:29
protectorHeath Stewart27-Feb-04 3:29 
GeneralRe: Array of Interfaces Pin
Werdna27-Feb-04 5:26
Werdna27-Feb-04 5:26 
Generaldatagrid to windows form Pin
ASGill26-Feb-04 17:27
ASGill26-Feb-04 17:27 
GeneralRe: datagrid to windows form Pin
Mazdak26-Feb-04 21:15
Mazdak26-Feb-04 21:15 
GeneralRe: datagrid to windows form Pin
ASGill28-Feb-04 15:38
ASGill28-Feb-04 15:38 
GeneralRe: datagrid to windows form Pin
Mazdak28-Feb-04 21:42
Mazdak28-Feb-04 21:42 
GeneralContext Menu Events Pin
BigBlob20226-Feb-04 16:53
BigBlob20226-Feb-04 16:53 
OK. I'm workin on this program and theres this one part of it that loads all of the names of the files in a certain folder, and then adds them to a context menu. Now here is where i run into my problem. I want to make it so that you can click on the menu item in the context menu (which was loaded when the program opened) and have it open its corresponding file in the folder it was loaded from.


Here is the code i used to load the files:

string[] files = Directory.GetFiles(@"docs\");<br />
int fnumber = files.Length;<br />
			<br />
for(int cNumber = 0; cNumber != fnumber; cNumber++)<br />
{<br />
   string fileName = Path.GetFileNameWithoutExtension(files[cNumber]);<br />
   MenuItem menuItem = new MenuItem();<br />
   menuItem.Text = fileName;<br />
   contextMenu.MenuItems.Add(0, menuItem);<br />
}


Now all i need is an event handler for each menu item that can open the right file. If you know how to do this, then please tell me. Thanks.





By BigBlob202
check out my site - Dinco Inc. - I just started it so theres not much on it.
GeneralRe: Context Menu Events Pin
Nick Parker26-Feb-04 17:42
protectorNick Parker26-Feb-04 17:42 
GeneralRe: Context Menu Events Pin
BigBlob20226-Feb-04 18:02
BigBlob20226-Feb-04 18:02 
GeneralRe: Context Menu Events Pin
Nick Parker26-Feb-04 18:32
protectorNick Parker26-Feb-04 18:32 
GeneralRe: Context Menu Events Pin
BigBlob20227-Feb-04 7:49
BigBlob20227-Feb-04 7:49 
QuestionHow to gain access to a network share? Pin
Throckmorton26-Feb-04 14:44
Throckmorton26-Feb-04 14:44 
AnswerRe: How to gain access to a network share? Pin
Verdant12326-Feb-04 16:37
Verdant12326-Feb-04 16:37 
AnswerRe: How to gain access to a network share? Pin
Heath Stewart27-Feb-04 3:23
protectorHeath Stewart27-Feb-04 3:23 
QuestionHow to start a process within the current command window? Pin
Throckmorton26-Feb-04 13:59
Throckmorton26-Feb-04 13:59 
AnswerRe: How to start a process within the current command window? Pin
Throckmorton26-Feb-04 14:08
Throckmorton26-Feb-04 14:08 
QuestionDataGrid - navigation to parent table? Pin
Radoslav Bielik26-Feb-04 10:48
Radoslav Bielik26-Feb-04 10:48 
AnswerRe: DataGrid - navigation to parent table? Pin
Heath Stewart26-Feb-04 12:39
protectorHeath Stewart26-Feb-04 12:39 
GeneralRe: DataGrid - navigation to parent table? Pin
Radoslav Bielik26-Feb-04 12:45
Radoslav Bielik26-Feb-04 12:45 
GeneralRe: DataGrid - navigation to parent table? Pin
Radoslav Bielik27-Feb-04 0:06
Radoslav Bielik27-Feb-04 0:06 
GeneralRe: DataGrid - navigation to parent table? Pin
Heath Stewart27-Feb-04 2:56
protectorHeath Stewart27-Feb-04 2:56 
GeneralRe: DataGrid - navigation to parent table? Pin
Radoslav Bielik27-Feb-04 3:47
Radoslav Bielik27-Feb-04 3:47 
GeneralTraceListener.Close not called when added through config file... Pin
Ryan Cromwell26-Feb-04 10:24
Ryan Cromwell26-Feb-04 10:24 
GeneralRe: TraceListener.Close not called when added through config file... Pin
John Fisher26-Feb-04 10:34
John Fisher26-Feb-04 10:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.