in code objects

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • aterlamia

    in code objects

    How do you create objects like buttons and labels
    with only code for example when you dont know how much buttons you need but
    you can callculate it when teh programm runs and the program make the
    buttons.

    thaks

    aterlamia


  • Peter Kragh

    #2
    Re: in code objects

    aterlamia wrote:[color=blue]
    > How do you create objects like buttons and labels
    > with only code for example when you dont know how much buttons you
    > need but you can callculate it when teh programm runs and the program
    > make the buttons.
    >[/color]

    Try something like this:

    Private Sub Command1_Click( )
    Controls.Add "VB.CommandButt on", "btn1"
    With Me!btn1
    .Caption = "Test"
    .Visible = True
    .Width = Me.Width
    .Height = 400
    End With
    Command1.Enable d = False ' Avoid creating another btn1 object
    End Sub

    BR,
    Peter Kragh


    Comment

    • J French

      #3
      Re: in code objects

      On Mon, 13 Oct 2003 18:49:48 +0200, "aterlamia" <mplouwerse@pla net.nl>
      wrote:
      [color=blue]
      >How do you create objects like buttons and labels
      >with only code for example when you dont know how much buttons you need but
      >you can callculate it when teh programm runs and the program make the
      >buttons.[/color]

      Look at 'Control Arrays'

      Comment

      • aterlamia

        #4
        Re: in code objects

        ok thanks to both i think this will help me :)


        "aterlamia" <mplouwerse@pla net.nl> wrote in message
        news:bmelcr$3lb $1@reader11.wxs .nl...[color=blue]
        > How do you create objects like buttons and labels
        > with only code for example when you dont know how much buttons you need[/color]
        but[color=blue]
        > you can callculate it when teh programm runs and the program make the
        > buttons.
        >
        > thaks
        >
        > aterlamia
        >
        >[/color]


        Comment

        Working...