Results 1 to 12 of 12

Thread: Shape Buttons?

  1. #1

    Thread Starter
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Question

    Does anyone out there know how to create a different Shape command button? I'm bored with the regular ones?

    Thanks,
    quadoc

  2. #2
    Addicted Member
    Join Date
    Nov 1999
    Posts
    184
    Easy!

    Make a Picture of your command button
    With the name of it in the picture.

    Put a picture on your form

    Put the command button picture in the
    pictureBox

    Sub Picture1_Click()
    'Picture1.picture = loadpicture(Pushes down command button)
    'Your Command Button code
    'Sleep 1000
    'Picture1.picture =loadpicture(reg cmdbut)
    end sub

    That help??
    End sub
    Evan Duffield --------
    --- [email protected]
    - -
    VB6 - Learning Edition
    - -


  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    As my page is just updated, after struggle and braindamages, you can download a transparent control from my site. The idea is to cut regions with some apis' but that's too much to explain for me on 5 mins.
    http://www.geocities.com/kedasu - I know you wanted the link directly to the control, but i want some feedback for my site, i have worked on it in three days.
    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.

  4. #4
    Guest
    Here's a way to make a button from an image. It will respond and act like a real button. I took it from the sample project called MDINote.

    You should have 3 images.

    imgButton = The main button
    imgButtonUp = The unpressed form of the button
    imgButtonDn = The pressed form of the button

    Code:
    Private Sub imgButton_MouseDown(Button As Integer, Shift As Integer, x As Single, Y As Single)
        ' Show the picture for the down state.
        imgButton.Picture = imgButtonDn.Picture
    End Sub
    
    
    Private Sub imgButton_MouseMove(Button As Integer, Shift As Integer, x As Single, Y As Single)
        ' If the button is pressed, display the up bitmap when the
        ' mouse is dragged outside the button's area; otherwise,
        ' display the down bitmap.
        Select Case Button
        Case 1
            If x <= 0 Or x > imgButton.Width Or Y < 0 Or Y > imgButton.Height Then
                imgButton.Picture = imgButtonUp.Picture
            Else
                imgButton.Picture = imgButtonDn.Picture
            End If
        End Select
    End Sub
    
    
    Private Sub imgButton_MouseUp(Button As Integer, Shift As Integer, x As Single, Y As Single)
        ' Show the picture for the up state.
        imgButton.Picture = imgButtonUp.Picture
    End Sub
    [Edited by Megatron on 05-15-2000 at 03:50 PM]

  5. #5

    Thread Starter
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Unhappy Shape Command Button

    So what you're telling me if the picture is round the button will becomes round? My post message is to create a different shape buttons like round or eclipse?

  6. #6
    Guest
    You can have whatever shap of button you ant with the method above. All yoiu have to do is draw your own buttons. (using Paint or some Image editing tool). Draw one for the image Unpressed and Pressed.

  7. #7

    Thread Starter
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Smile Shape Command Button

    Thanks Megatron and everyone!!!

  8. #8
    Guest

    Wink Dude, have a control for button shapes

    Some one sent me npButton a year or so back, it's an ocx that allows some cool button shapes, e.g round, oval etc with decent colouring. Email if you want the control, its in the public domain

    Regards

  9. #9

    Thread Starter
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Smile Shape Command Button

    Jethro, could you email me a copy of the OCX? My email
    address is [email protected]. Thanks!!!

  10. #10
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Smile Jethro :)

    Just wan't to look at your ocx, i wan't to know if i've missed something in mine ([email protected])

    [Edited by kedaman on 05-16-2000 at 04:46 PM]
    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.

  11. #11

    Thread Starter
    Lively Member quadoc's Avatar
    Join Date
    Jan 1999
    Location
    Ga, USA
    Posts
    83

    Lightbulb Shape Command Button

    kedaman, what is the transparent control? Does it let me
    create different shape command button? Thanks!

  12. #12
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Actually it's just a transparent picturebox, a wnd with cutted regions specified by a maskcolor. Well, it's not a commandbutton but you can put it to act as one, changing the image when you click on it (in the event). It's not hard to do at all.
    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.

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