473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

How to make button to be pressed(graphically down and stay) when user click on it?

Mat


Nov 20 '05 #1
5 10464
* "Mat" <re**********@fuckSpam.COM> scripsit:
[Nothing]

\\\
Private Declare Auto Function SendMessage Lib "user32.dll" ( _
ByVal hWnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32 _
) As Int32

Private Const BM_SETSTATE As Int32 = &HF3
Private Const BM_GETSTATE As Int32 = &HF2

Private m_blnDown As Boolean

..
..
..

Private Sub Timer1_Tick( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Timer1.Tick
If m_blnDown Then
SendMessage(Me.Button1.Handle, BM_SETSTATE, 0, 0)
Else
SendMessage(Me.Button1.Handle, BM_SETSTATE, 1, 0)
End If
m_blnDown = Not m_blnDown
End Sub
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2
Mat
Thanks you.
i will try it
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:uZ**************@TK2MSFTNGP09.phx.gbl...
* "Mat" <re**********@fuckSpam.COM> scripsit:
[Nothing]

\\\
Private Declare Auto Function SendMessage Lib "user32.dll" ( _
ByVal hWnd As IntPtr, _
ByVal wMsg As Int32, _
ByVal wParam As Int32, _
ByVal lParam As Int32 _
) As Int32

Private Const BM_SETSTATE As Int32 = &HF3
Private Const BM_GETSTATE As Int32 = &HF2

Private m_blnDown As Boolean

.
.
.

Private Sub Timer1_Tick( _
ByVal sender As System.Object, _
ByVal e As System.EventArgs _
) Handles Timer1.Tick
If m_blnDown Then
SendMessage(Me.Button1.Handle, BM_SETSTATE, 0, 0)
Else
SendMessage(Me.Button1.Handle, BM_SETSTATE, 1, 0)
End If
m_blnDown = Not m_blnDown
End Sub
///

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>

Nov 20 '05 #3
BB
Mat,

Another suggestion: use a "radio button" instead, and
set .appearance to "button". This will give you a button
that "stays down" when it is "checked".

Bill
-----Original Message-----
.

Nov 20 '05 #4

"BB" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Mat,

Another suggestion: use a "radio button" instead, and
set .appearance to "button". This will give you a button
that "stays down" when it is "checked".

Bill

The same can be used with a checkbox if you dont want a group of them.


Nov 20 '05 #5
Mat
Your method is much more better...
Thanks for the TIP . i never know that
"BB" <an*******@discussions.microsoft.com> wrote in message
news:04****************************@phx.gbl...
Mat,

Another suggestion: use a "radio button" instead, and
set .appearance to "button". This will give you a button
that "stays down" when it is "checked".

Bill
-----Original Message-----
.

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: JerryP | last post by:
Hi Group, is there any easy way to get the status of the CTRL Key in the Button Click event ? I'd like to implement a functionality compareable to Windows Explorer DELTE - it behaves a little...
1
by: David Hearn | last post by:
I have a javascript function that is fired on the KeyDown event of a textbox. I am adding the attribute to the textbox at page load to run this javascript function. The javascript runs as expected...
11
by: CW | last post by:
I have message entry screen that's causing me a bit of an issue. At the moment, there are 2 buttons, one is used to send message to another user (btnSend) and another is used to send messages to...
2
by: Samy | last post by:
Hi There, I have a user control with buttons on it which I use on a aspx page (parent page). On a button click, a modal dialog(aspx page) opens up and the user enters some info in the modal dialog...
4
by: touf | last post by:
Hi, How can I invoke by code a buttoin click event. I like to call the function that handles the button click. I'\ve seen the command RAISEEVENT but I didn't know how to use it ion this case....
7
by: code100579 | last post by:
Hi there, sorry if this is a really simple question. I need to write code for: If a button is pushed and then one variety of other buttons is pushed then certain options on the program will...
2
by: Steph. | last post by:
Hi, A simple question : How can I detect if the CTRL key is pressed when User click on a control ? Thanks, Steph.
2
by: Max2006 | last post by:
Hi, I have a simple form with a button on it. After a button click postback, anytime user press F5 (browser page refresh), the button's OnClick event handler is called again without the button...
9
by: ghjk | last post by:
change the background image when Button Click ====================================== I' developing site with php and postgres. It has menus list in the left side. and all are images(jpg) EX:Add...
1
by: cluless | last post by:
Hey everybody, I have a database with one major form that has a few subforms and a listbox, and on the form there are buttons that link to other forms as well. Once the list box is clicked on, the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.