By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,223 Members | 1,392 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,223 IT Pros & Developers. It's quick & easy.

can any one help me by suggesting a way to get items in dynamic form?

P: 42
hi all...
can any one help me by suggesting a way to get items in dynamic form?

here what i'm doing is , i'm displaying a dynamic form. in that form i have a main menu and this main menu contains a menu item "OK". here the dynamic form consist of some labels, list items and all. when i click on the "OK" menu item, an event occurs and i've wrote methods which wll execute on this event.
now i need the selected list item index,value.. label text etc...

can any one help me by suggesting an idea to get the selected item index,values label text etc in the method that i've created for this event...
this method lies in a seperate class...
Nov 4 '08 #1
Share this Question
Share on Google+
4 Replies


markmcgookin
Expert 100+
P: 648
What's wrong with

Expand|Select|Wrap|Line Numbers
  1. string list = this.listBox1.SelectedItem.Text;
  2. string lable = this.lable1.text;
  3.  
I don't really understand what you are after here... please explain more about you environment, language etc.

If you read the Bytes how to post a question thread before posting this would help a lot.
Nov 4 '08 #2

P: 42
Expand|Select|Wrap|Line Numbers
  1. private void button2_Click(object sender, EventArgs e)
  2.         {
  3.  
  4.            display_page ob = new display_page();
  5.            forms ab=ob.display_xml_page("/My Documents/My Pictures/pave1.xml");
  6.         //here what come in return is a form object accept it in a form object and display it.
  7.            MenuItem menuItem1 = new MenuItem();
  8.  
  9.             menuItem1.Text = "ok";
  10.            menuItem1.Click += new System.EventHandler(menuItem1_Click);
  11.  
  12.  
  13.            ab.mainMenu1.MenuItems.Add(menuItem1);
  14.  
  15.            Event_class oo = new Event_class();
  16.            menuItem1.Text = "ok";
  17.            menuItem1.Click += new System.EventHandler(oo.menuItemOK_Click);
  18.            ab.Menu = ab.mainMenu1;
  19.            ab.Show();
  20.         }
  21.  
this is a button click action.... here when we call the function "display_xml_page("/My Documents/My Pictures/pave1.xml");" what comes in return is a form object ... which will be having list item , labels etc....
here i've added an event "new System.EventHandler(oo.menuItemOK_Click);"
here is the event class method...

Expand|Select|Wrap|Line Numbers
  1.  public void menuItemOK_Click(object sender, EventArgs e)
  2.         {
  3.  
  4.          }
  5.  
here what ever i do produces error...
i cannot access this.listbox1.text etc etc... nothing is happenning here...
am i missing something here???

MODERATOR: EDITED: Please remember to use code tags!
Nov 4 '08 #3

P: 42
this application is for windows mobile and it is in c#.net...
please dont mind... i'm new in windows application..
Nov 4 '08 #4

jkmyoung
Expert 100+
P: 2,057
Sounds like a scope error, common with javascript event handling.
Could we see perhaps 1 line of what you've tried to put in the event handler, and the corresponding error?

(To be honest, I forget the exact solution and the error msg would help me find it.)
Nov 4 '08 #5

Post your reply

Sign in to post your reply or Sign up for a free account.