Connecting Tech Pros Worldwide Help | Site Map

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

Member
 
Join Date: Oct 2008
Posts: 42
#1: Nov 4 '08
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...
markmcgookin's Avatar
Moderator
 
Join Date: Dec 2006
Location: Northern Ireland / England
Posts: 546
#2: Nov 4 '08

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


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.
Member
 
Join Date: Oct 2008
Posts: 42
#3: Nov 4 '08

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


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!
Member
 
Join Date: Oct 2008
Posts: 42
#4: Nov 4 '08

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


this application is for windows mobile and it is in c#.net...
please dont mind... i'm new in windows application..
Moderator
 
Join Date: Mar 2006
Posts: 1,103
#5: Nov 4 '08

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


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.)
Reply