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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • libish
    New Member
    • Oct 2008
    • 42

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

    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
    Recognized Expert Contributor
    • Dec 2006
    • 648

    #2
    What's wrong with

    Code:
    string list = this.listBox1.SelectedItem.Text;
    string lable = this.lable1.text;
    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.

    Comment

    • libish
      New Member
      • Oct 2008
      • 42

      #3
      Code:
      private void button2_Click(object sender, EventArgs e)
              {
                  
                 display_page ob = new display_page();
                 forms ab=ob.display_xml_page("/My Documents/My Pictures/pave1.xml");
              //here what come in return is a form object accept it in a form object and display it.
                 MenuItem menuItem1 = new MenuItem();
                 
                  menuItem1.Text = "ok";
                 menuItem1.Click += new System.EventHandler(menuItem1_Click);
      
      
                 ab.mainMenu1.MenuItems.Add(menuItem1);
      
                 Event_class oo = new Event_class();
                 menuItem1.Text = "ok";
                 menuItem1.Click += new System.EventHandler(oo.menuItemOK_Click);
                 ab.Menu = ab.mainMenu1;
                 ab.Show();
              }
      this is a button click action.... here when we call the function "display_xml_pa ge("/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.EventHan dler(oo.menuIte mOK_Click);"
      here is the event class method...

      Code:
       public void menuItemOK_Click(object sender, EventArgs e)
              {
      
               }
      here what ever i do produces error...
      i cannot access this.listbox1.t ext etc etc... nothing is happenning here...
      am i missing something here???

      MODERATOR: EDITED: Please remember to use code tags!

      Comment

      • libish
        New Member
        • Oct 2008
        • 42

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

        Comment

        • jkmyoung
          Recognized Expert Top Contributor
          • Mar 2006
          • 2057

          #5
          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.)

          Comment

          Working...