Results 1 to 6 of 6

Thread: How can I add control to a form

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Geneve , Switzerland
    Posts
    64

    Unhappy

    A know ... click the tool bar and draw ...
    Of course I know that
    but I am tring to the thing below
    I already build a Array of only one image control
    How do I add more image to this Array with commands ?
    (Have to create image with commands ... in fact)

    I don't think anyone would be able to do it !


  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Just put the controls index to 0 at designtime and use load command to load another instance of it (1).
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  3. #3
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    You got about halfway there, you nead to use
    Load Image1(intNewIndex) to get a new image. The new image is invisible, and has exactly the same properties as the old one. So you need to make is visible and move it.

    Here's an example using command buttons. You need a form with a command button Command1 on it, set it's index property to 0.

    add this code

    Code:
    Dim MaxIndex As Long
    
    Private Sub Command1_Click(Index As Integer)
    
    
    MaxIndex = MaxIndex + 1
    Load Command1(MaxIndex)
    Command1(MaxIndex).Visible = True
    Command1(MaxIndex).Top = Command1(MaxIndex - 1).Top + Command1(0).Height
    End Sub
    Hope this Helps

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Well, sam, he didn't ask for that, he did just ask to create a instance of an object. But ofcourse if it's an image you need to move it and have the original invisible and things, probably also loading new images into that. But he can do it by himself
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  5. #5
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Ah, but the command button example was a lot because you don't need to load pictures etc in. Plus I provided some code.

  6. #6
    Guest

    If you would like to create it from scratch, than read the
    method I posted in this thread (Only available in VB6)

    http://forums.vb-world.net/showthrea...threadid=17020

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