Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

my MDI application create menu dynamicaly from a database.

it get menu names and create them and add them to mainmenu of my mdi app.

for each menu i add event that come up its name.

in this case add event "name1_click" to menus that named "name1"

but if there isn't any function with this address "name1_click" debuger return error that there is this function.

ok. how can i check availability of this function before add event?

 

i need a function that get a string and return true if there was a function with it string.

 

private bool isfunction(string funcName)
{
  if(there is function as name funcName)
     return true;
  else
     return false
}
private addEventToMenu(string menuName)
{
  Menu newmenu = ....
  //after create menu
  
  if(isfunction(menuName+"_Click"))
      .... add event menuName+"_Click" to newmenu
  else
      add defaultMenu_Click to newmenu
}

:-\

[ once4ever ]
Posted
To the best of my knowledge this isn't possible. You would be better off having a single function for all menu's that has a switch statement based on the menu name.
Anybody looking for a graduate programmer (Midlands, England)?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...