473,320 Members | 1,868 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,320 software developers and data experts.

whats the best way to do this with buttons



I have a form with 8 checkbuttons in "button" apearence mode

each button press activates a relay device on a connected piece of
hardware.

For the relay device to activate a specfic relay it needs to get a
number of the relay to be used from the button pressed

EG press button 1, activates relay number 1, button 2 activates relay
2.

So how can i do this:

with 8 check buttons on the form (in a panel) how can i direct the
"mousedown" and mouseup events for ALL 8 checkbuttons to only 1 method
or event that will derive the button pressed, and extract from that
the number of the button that will correspond to the relay number that
i can send to the relay device.

I also need to check if its the mouseup or mousedown even that
triggered the call.

Comms with the relay device is working so dont worry about that.

I just cant think of a way to derive a corresponding number resulting
from the relevant button to be pressed, via only 1 method that each
button points to for the mouseup and mousedown events

I hope this was clear in explaining

thanks for any advice
Mar 1 '07 #1
1 1088
On 1 Mrz., 08:13, Peted wrote:
I have a form with 8 checkbuttons in "button" apearence mode

each button press activates a relay device on a connected piece of
hardware.

For the relay device to activate a specfic relay it needs to get a
number of the relay to be used from the button pressed

EG press button 1, activates relay number 1, button 2 activates relay
2.

So how can i do this:

with 8 check buttons on the form (in a panel) how can i direct the
"mousedown" and mouseup events for ALL 8 checkbuttons to only 1 method
or event that will derive the button pressed, and extract from that
the number of the button that will correspond to the relay number that
i can send to the relay device.

I also need to check if its the mouseup or mousedown even that
triggered the call.

Comms with the relay device is working so dont worry about that.

I just cant think of a way to derive a corresponding number resulting
from the relevant button to be pressed, via only 1 method that each
button points to for the mouseup and mousedown events

I hope this was clear in explaining

thanks for any advice
You could simply hook up all 8 mouseup/mousedown events to the same
handler-function and then act depending on the sender parameter.
Alternatively you could put the number in the tag of each control and
use that.

Sincerely,
Kevin Wienhold

Mar 1 '07 #2

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

Similar topics

131
by: Peter Foti | last post by:
Simple question... which is better to use for defining font sizes and why? px and em seem to be the leading candidates. I know what the general answer is going to be, but I'm hoping to ultimately...
2
by: JR | last post by:
Hi. I have a CGI script that will need to call itself an unknown number of times, to add rows, run queries, etc. At the bottom of the output that is produced by the script, there are four...
2
by: Dan V. | last post by:
What do you recommend to use for saving time and get great results for making image and css buttons on a site? Also top tabs like for navigation. Separate question maybe is what is the best tool...
1
by: Chris Uwins | last post by:
Hi there, i know theres a number of ways I can achieve this but want to know the best, (but still quite simple). Up until a year ago I never used Access but have designed a few databases for...
4
by: David Lozzi | last post by:
OK simple question. Whats the default value for an string() array? sub LoadStuff(byval one as integer, byval two as string, optional byval three() as string = ??) Its driving me nuts! ...
4
by: markrush | last post by:
if i have 2 datasources with different table names and column headers that i want to merge i.e. "ptitle" and "name" whats the best way of doing this? are there any standard routines or should i use...
2
by: moondaddy | last post by:
I'm using WPF and c#. Whats the best way for a child class to know about it's parent class? For examle class ParentClass : CollectionBase { // code... class ChildClass { // code...
7
by: Paulo | last post by:
Hi, what is diference between: File -New Web Site and File -New Project -VB/C# -Web Application ?????? VS 2005
7
by: Rohit | last post by:
Hi, I am working on a switch module which after reading voltage through a port pin and caterogizing it into three ranges(open,low or high), passes this range to a function switch_status() with...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

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.