Results 1 to 9 of 9

Thread: cmd button won't stay "in"

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    How do I make a command button stay in? (Like the way it looks with the mouse button held down) I always thought this was a property but now that I need it I can't find it! Can anyone help?
    Thanks
    JoeyO

  2. #2
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Well, you could always use the option button with the style property set to 1 - Graphical.
    I just figured this out yesterday

    You can also use a tabstrip control with a button style or a toolbar control, or even a status bar control. Depends on what you need it for of course.

    Good luck

    ------------------
    Micah Carrick
    http://micah.carrick.com
    [email protected]
    ICQ: 53480225


  3. #3
    Addicted Member ZanM's Avatar
    Join Date
    Oct 1999
    Location
    The here and now.
    Posts
    191

    Post

    ok one way to do it if you want a graphical i-face is to use bitblt
    If you have adobe abd a bevel filter go in and make a button bevel it make another button and indent it

    start a stander exe project add the folowing

    Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
    Public Const SRCCOPY = &HCC0020

    add the bitblt function and the srccopy constant to a module in your project

    ok on your form place three picture boxs name 1 buttonUp 1 buttonDown and one Cmd

    load your button pic in to buttonUp & Down respectively

    now make sure the auto redraw for cmd is set to true and make it the same height and width of your button pics

    in the mousedown of cmd put this code
    call bitblt(cmd.hdc,0,0,cmd.width,cmd.height,buttonDown.hdc,0,0,srccopy)
    cmd.refresh

    in the mouseup put
    call bitblt(cmd.hdc,0,0,cmd.width,cmd.height,buttonUp.hdc,0,0,srccopy)
    cmd.refresh

    ok that gives you a button ok now once you see how it works you can hold up the refresh to keep it down till you want it up

    ------------------
    SomeTimes Coffee Just Isn't Enough.
    Zan Magi

  4. #4
    Addicted Member ZanM's Avatar
    Join Date
    Oct 1999
    Location
    The here and now.
    Posts
    191

    Post

    ok one way to do it if you want a graphical i-face is to use bitblt
    If you have adobe abd a bevel filter go in and make a button bevel it make another button and indent it

    start a stander exe project add the folowing

    Public Declare Function BitBlt Lib "gdi32" (ByVal hDestDC As Long, ByVal X As Long, ByVal Y As Long, ByVal nWidth As Long, ByVal nHeight As Long, ByVal hSrcDC As Long, ByVal xSrc As Long, ByVal ySrc As Long, ByVal dwRop As Long) As Long
    Public Const SRCCOPY = &HCC0020

    add the bitblt function and the srccopy constant to a module in your project

    ok on your form place three picture boxs name 1 buttonUp 1 buttonDown and one Cmd

    load your button pic in to buttonUp & Down respectively

    now make sure the auto redraw for cmd is set to true and make it the same height and width of your button pics

    in the mousedown of cmd put this code
    call bitblt(cmd.hdc,0,0,cmd.width,cmd.height,buttonDown.hdc,0,0,srccopy)
    cmd.refresh

    in the mouseup put
    call bitblt(cmd.hdc,0,0,cmd.width,cmd.height,buttonUp.hdc,0,0,srccopy)
    cmd.refresh

    ok that gives you a button ok now once you see how it works you can hold up the refresh to keep it down till you want it up

    ------------------
    SomeTimes Coffee Just Isn't Enough.
    Zan Magi

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    Hey thanks for the quick response!what I really need though is a button that shows exagerated depth when in the "on" position.The picture that shows when the mousebutton is held down is perfect for me.Does anyone know how I can access that affect without having to hold the button down?

  6. #6

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    Sorry about that last reply it went out before I got ZanM's reply. Thanks so much you guys are great!
    JoeyO

  7. #7
    Addicted Member
    Join Date
    May 1999
    Location
    Californ-I- A
    Posts
    207

    Post

    Did you try the option (radial button) already with style = 1-graphical? That toggles between depressed and pressed.

    Use Option1.Value = true to press it and Option1.Value = False to depress it

  8. #8
    Addicted Member ZanM's Avatar
    Join Date
    Oct 1999
    Location
    The here and now.
    Posts
    191

    Post

    sorry about the double post my browser hung up

    ------------------
    SomeTimes Coffee Just Isn't Enough.
    Zan Magi

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 1999
    Location
    ma,usa
    Posts
    485

    Post

    I am stupid and ignorant!Thank you for asking again MicahCarrick.On first reading I thought you were only giving me additional property "options" for my cmdbutton(I am very tired). This works great! I am going to sleep now!
    thanks
    joeyo

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