Error Unable to cast object~

Discussion in 'Questions (Windows Mobile)' started by UnknownArt, Dec 12, 2008.

  1. UnknownArt

    UnknownArt Member Licensed User

    Please let me know what is problem:

    Unable to cast object of type 'Dbasic.Crunner' to type 'System.Windows.forms.control'

    I am testing FormLib and AddContextMenu.


    == Source Code ===
    Sub Globals


    End Sub


    Sub App_Start
    Form1.Show
    FormLib1.New1("Form1",B4PObject(1))
    Context1.New1
    Context1.AddItem("Yes")
    Context1.AddItem("No")
    Context1.AddItem("-") 'Adds a separator
    Context1.AddItem("Maybe")
    FormLib1.AddContextMenu("TextBox1",Context1.Value)
    End Sub


    Sub Context1_Click
    Select Context1.SelectedText
    Case "Yes"
    'Do something
    Case "No"
    'Do something
    Case "Maybe"
    'Do something
    End Select
    End Sub
     
  2. agraham

    agraham Expert Licensed User

    You probably don't have a "Textbox1" control on your Form1.
     
  3. UnknownArt

    UnknownArt Member Licensed User

    Thank you so much~

    Thank you so much~
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice