Click to See Complete Forum and Search --> : cmd button won't stay "in"
joey o.
Jan 18th, 2000, 10:19 AM
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
MicahCarrick
Jan 18th, 2000, 10:22 AM
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
micah@carrick.com
ICQ: 53480225
ZanM
Jan 18th, 2000, 10:35 AM
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
ZanM
Jan 18th, 2000, 10:35 AM
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
joey o.
Jan 18th, 2000, 10:36 AM
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?
joey o.
Jan 18th, 2000, 10:39 AM
Sorry about that last reply it went out before I got ZanM's reply. Thanks so much you guys are great!
JoeyO
MicahCarrick
Jan 18th, 2000, 10:41 AM
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
ZanM
Jan 18th, 2000, 10:46 AM
sorry about the double post my browser hung up
------------------
SomeTimes Coffee Just Isn't Enough.
Zan Magi
joey o.
Jan 18th, 2000, 10:54 AM
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
vbforums.com
Copyright Internet.com Inc., All Rights Reserved.