locked
How to Select OPOS Device with TextBox Value RRS feed

  • Question

  • I have two Forms

    Main and Control Panel

    I have a line display code in Main form and I have some textboxes on Control Panel Form

    I am trying to get the value of the textbox on control panel form, so it will connect to the line display

    But under createinstance (device)   , it throws a NULL Error.

    explorer = New PosExplorer(Me)

            Dim device As DeviceInfo = explorer.GetDevice(ControlPanel.OPOSLineDisplay.Text)

            POSDisplay = explorer.CreateInstance(device)

    Thursday, January 3, 2013 8:59 AM

Answers

  • Hi Jcharles,

    You can also try to access the text box from Form.

    So you can try 

    Me.textbox1.text

    when you just drag the button from toolbox to a tabpage in the tabControl.

    If you add it from this kind of code:

            Dim ButtonTest As Button = New Button()
            ButtonTest.Name = "ButtonTest"
            ButtonTest.Text = "ButtonTest"
            TabControl1.TabPages(0).Controls.Add(ButtonTest)

    then, you can access it like this:

    Console.WriteLine(TabControl1.TabPages(0).Controls("ButtonTest").Text)

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Feng Thursday, January 10, 2013 9:40 AM
    Friday, January 4, 2013 2:17 AM

All replies

  • I figured it out.

    But,

    In the Control Panel form, I am behind a Tabbed Control

    how would I access textbox value behind tab control.

    controlpanel.tabcontrol1.tab1.textbox1.text ???????????

    Thanks

    • Marked as answer by jcharles11 Friday, January 25, 2013 12:04 PM
    • Unmarked as answer by Mike Feng Monday, January 28, 2013 4:51 AM
    Thursday, January 3, 2013 9:03 AM
  • Hi Jcharles,

    You can also try to access the text box from Form.

    So you can try 

    Me.textbox1.text

    when you just drag the button from toolbox to a tabpage in the tabControl.

    If you add it from this kind of code:

            Dim ButtonTest As Button = New Button()
            ButtonTest.Name = "ButtonTest"
            ButtonTest.Text = "ButtonTest"
            TabControl1.TabPages(0).Controls.Add(ButtonTest)

    then, you can access it like this:

    Console.WriteLine(TabControl1.TabPages(0).Controls("ButtonTest").Text)

    I hope this will be helpful.

    Best regards,


    Mike Feng
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Mike Feng Thursday, January 10, 2013 9:40 AM
    Friday, January 4, 2013 2:17 AM