Results 1 to 2 of 2

Thread: New Control At Runtime

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Aug 2003
    Posts
    83

    Post New Control At Runtime

    VB Code:
    1. Sub MouseMove (X As Integer, Y As Integer)
    2.   Dim o As OvalShape
    3.   If MouseX >=1 or MouseY >=1 Then
    4.     o = New OvalShape
    5.     'o.Visible
    6.     o.FillColor = RGB(255,0,0)
    7.     o.Width = 27
    8.     o.Height = 27
    9.     'o.Top = MouseX + 5
    10.     'o.Left = MouseY + 5
    11.   End if
    12. End Sub

    When trying to make a new control at runtime, which will be an OvalShape, it doesn't make the control, because the lines that I have 'commented' give me syntax errors, so RealBasic doesn't even recognize variable "o" as an OvalShape control. Can anyone tell me how to fix this?
    ---------------------------------
    Dubbemiah
    "Simply, a beginner."

  2. #2
    New Member
    Join Date
    Dec 2004
    Posts
    9

    Re: New Control At Runtime

    Instead of using:

    o.Visible

    Use:

    Me.Visible=True

    Same with
    o.Top = MouseX + 5
    o.Left = MouseY + 5

    Use Me.MouseX + 5 Blah Blah Blah

    HTH

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width