CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Mar 2001
    Location
    Manila,Philippines
    Posts
    116

    Create Buttons on RunTime(Not Design Time)

    Could it be possible to create buttons at runtime and not in design time? and also please explain the uses of commands being used ...
    i will appreciate it very much ....thanks


  2. #2
    Join Date
    Jul 2001
    Location
    maharashtra,india
    Posts
    181

    Re: Create Buttons on RunTime(Not Design Time)

    Dim cmd As CommandButton
    Set cmd = Controls.Add("vb.commandbutton", "Name")
    cmd.Visible = True

    Then u can set its left and right as u want
    Best of luck


  3. #3
    Join Date
    Jun 2000
    Posts
    104

    Re: Create Buttons on RunTime(Not Design Time)

    take a command button command1 at design time and set it's index property to 0.this will create a control array with the first item as command1(0).set it's visible property to false.now type this code in the event procedure.


    load command1(1)
    command1(1).visible=true
    command1(1).left=1000
    command1(1).top=1000




    if you want to create more than one command buttons then use this code


    static i as integer
    i=i+1
    load command1(i)
    command1(i).visible=true
    command1(i).left=1000
    command1(i).top=1000



    hope it helps you.





  4. #4
    Join Date
    Jul 2000
    Location
    Milano, Italy
    Posts
    7,726

    Re: Create Buttons on RunTime(Not Design Time)

    Have also a look here:
    http://codeguru.com/cgi-bin/bbs/wt/s...age=&view=&sb=

    Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Micahel
    and all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

    The Rater
    ...at present time, using mainly Net 4.0, Vs 2010



    Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
    all the other wonderful people who made and make Codeguru a great place.
    Come back soon, you Gurus.

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

Featured