Help with Tab Control?

Discussion in 'Questions (Windows Mobile)' started by EzCoder, Oct 23, 2007.

  1. EzCoder

    EzCoder Member Licensed User

    Hello,
    Very new to B4ppc and having some difficulty from a desktop app...

    With this code taken from the help file:
    Code:
    'Add a TabControl object named tbc.
    Sub Globals


    End Sub


    Sub App_Start
          Form1.Show
          AddButton(Form1,
    "Button1",0,0,80,40,"Button1")
          AddTextBox (Form1,
    "TextBox1",40,20,100,25,"")
          tbc.New1 (
    "Form1"10,10200200)
          tbc.AddTabPage(
    "Page1")
          tbc.AddTabPage(
    "Page2")
          tbc.AddTabPage(
    "Page3")
          tbc.AddControl(
    "Button1",0,20,20)
          tbc.AddControl(
    "TextBox1",1,20,30)
    End Sub


    Sub tbc_SelectionChanged
          
    msgbox("Selected page: " & tbc.SelectedIndex)
    End Sub
    I'm getting an error that I don't understand. (Image attached)

    Can someone shed some light here or have some working code as a simple example?
     

    Attached Files:

  2. agraham

    agraham Expert Licensed User

    Looks like you haven't added a "Form1" to your project!
     
  3. EzCoder

    EzCoder Member Licensed User

    Yikes!!! :sign0148:

    It always seems to be the most obvious things that I overlook.

    ....a perfect way to start off around here.

    Thanks for the assist.
     
  4. EzCoder

    EzCoder Member Licensed User

    I continued to have problems but finally figured out what I was doing wrong.

    As it turns out, being completely unfamiliar with how everything works in the IDE, I was leaving out the part about actually adding the tab control as an object (named tbc of course). :(

    It all works now and I've learned something new in the process. :sign0060:
     
Loading...