VB.Net-2005 variable transfer from main form to dialog box, 2-nd (not main) project o

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AlenVic
    New Member
    • Jun 2015
    • 3

    VB.Net-2005 variable transfer from main form to dialog box, 2-nd (not main) project o

    VB.Net-2005.
    I have two projects in one solution. The problem relates to the second project only.
    In the second project I have main form and dialog box.
    On main form I have combo box with few selections. I need to read value from that combo box (on main form) to dialog box.
    When I set "stop" being in "form load" of dialog box and say: strValue = mainForm.comboB ox.SelectedItem the strValue equals to nothing. Why? The focus gets to "form load" event of dialog box, reads statement strValue = ...., jumps to mainForm, returns with "nothing" value.
    Note: if I do exactly the same thing being in first (main) project of the solution, everything works fine, i.e. value is delivered, not lost.
    Could anyone explain how to get that value of comboBox to dialog box ?
    Thank you
    Alen Vic.
  • Seth Schrock
    Recognized Expert Specialist
    • Dec 2010
    • 2965

    #2
    Try setting up a global variable in a module. Set the value of the global variable when the combobox is changed (After Update event). You should then be able to read this variable when your dialog box opens.

    Comment

    • AlenVic
      New Member
      • Jun 2015
      • 3

      #3
      Thank you very much Seth.

      Comment

      Working...