473,387 Members | 3,820 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,387 software developers and data experts.

Active Control trigger

On one of my forms I display a histogram representing the status
of jobs in our factory. It's configured as a stacked bar which I
create using labels of different background colors. 75 labels are
arranged in, up to, 15 vertical bars representing different customers.
When the user clicks on one of the labels I display a list box with
details about the data in the bar.

I only want to know which stack and which bar was clicked so I can
display the related data. It is easy enough to create 75 event
handlers to deal with each possible click but I would hope that there
is a more elegant way to handle this. I wanted to use Active Control
to get the name of the Label that was clicked but Active Control is a
Property and not an event. So I need an event that sends me to the
function that will use Active Control to determine the name of the
clicked label and send me to the function that explodes the data.
Thanks,
Hank Reed

Nov 13 '05 #1
3 2512
Hank wrote:
On one of my forms I display a histogram representing the status
of jobs in our factory. It's configured as a stacked bar which I
create using labels of different background colors. 75 labels are
arranged in, up to, 15 vertical bars representing different customers.
When the user clicks on one of the labels I display a list box with
details about the data in the bar.

I only want to know which stack and which bar was clicked so I
can display the related data. It is easy enough to create 75 event
handlers to deal with each possible click but I would hope that there
is a more elegant way to handle this. I wanted to use Active Control
to get the name of the Label that was clicked but Active Control is a
Property and not an event. So I need an event that sends me to the
function that will use Active Control to determine the name of the
clicked label and send me to the function that explodes the data.
Thanks,
Hank Reed


Use TextBoxes instead of Labels because Labels cannot receive focus. With a
TextBox you could use Me.ActiveControl or Screen.ActiveControl.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2
Or if you wanted to keep labels so that the controls can't be clicked into
and receive the focus (giving the game away of how you achieved your look)
then you could write one function with an argument that determines the bar
that clicked it.
e.g. fActionBar(intBar as integer) and call that directly in the click
event.
i.e. =fActionBar(1), =fActionBar(2) etc etc

(If altering the passed integer for each of the 75 labels seems daunting
then you could write some code to loop through them and enter the function
accordingly - this would require your labels to have a consistent naming
convention of course - but in a situation as you describe I'd imagine you'd
have to do that anyway).

hth
--
---------------------------------------------------------------
Mr Leigh Purvis - Proprietor
Database Development
---------------------------------------------------------------
Email: Le***@DatabaseDevelopment.co.uk
Web: www.DatabaseDevelopment.co.uk
Mobile: 07713 166938
---------------------------------------------------------------
"Hank" <ha********@aol.com> wrote in message
news:11*********************@z14g2000cwz.googlegro ups.com...
On one of my forms I display a histogram representing the status
of jobs in our factory. It's configured as a stacked bar which I
create using labels of different background colors. 75 labels are
arranged in, up to, 15 vertical bars representing different customers.
When the user clicks on one of the labels I display a list box with
details about the data in the bar.

I only want to know which stack and which bar was clicked so I can
display the related data. It is easy enough to create 75 event
handlers to deal with each possible click but I would hope that there
is a more elegant way to handle this. I wanted to use Active Control
to get the name of the Label that was clicked but Active Control is a
Property and not an event. So I need an event that sends me to the
function that will use Active Control to determine the name of the
clicked label and send me to the function that explodes the data.
Thanks,
Hank Reed

Nov 13 '05 #3
Thanks to Rick and Leigh for their input. I changed the labels to
text boxes. Then I wrote a function that:
1. Determines the active control
2. Parses out the unique part of the control name (No problem Leigh)
3. Calls the function that displays the requested data

I put that Function name in the Click Event field of each text box
(Instead of [Event Procedure]) and now any click on any histogram bar
follows the above path and displays my data. If anyone wants to see
the code, just ask.

Thanks again,
Hank Reed

Nov 13 '05 #4

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

Similar topics

11
by: Wilhelm Kutting | last post by:
Hi i got a problem running the active tag i use in my stylesheet definition #menu li a:active{ color: #8B008B; } What didt't work out Using
3
by: Robert Neville | last post by:
How do you return the last Active Control when the control is on a tab control? Screen.ActiveControl does not seem to work. Here's the statement that my code uses. Set ctlOld =...
2
by: Lyn | last post by:
Hi, I have a text control on a form which is bound to table field StartDate which is in Date format. When updating the table record via the form, any data entered into the StartDate control is...
0
by: Kannan | last post by:
My application is an MFC application but since MFC is essentially a Object Oriented wrapper for Win32 I am taking the liberty to post my question here. I also must confess that I am not an Active X...
2
by: Owin | last post by:
Hi all, I've created an User control. It's an extension of a textbox wich has some extra properties so that validation becomes a lot faster. The control wordks great if autopostback is on. When...
1
by: Morten Snedker | last post by:
Just for the sake of learning, I'm trying to make a simple Active-X in VB.NET. It should contain the MonthCalendar control, a date should be picked, and the Active-X control would return the...
4
by: Sarita Sai Bhushan | last post by:
Hi, While I was developing a active desktop web page in ASP.Net using server controls I faced a problem with the autopostback property of server control. The sever control I used in my aspx page...
2
by: Alan Mailer | last post by:
Ok, I'm pretty new to VB.Net, so please bear with me. Imagine the Load event of one of my forms includes the following: Dim ctrl as Control Dim txtbox As TextBox For Each ctrl In Me.Controls...
1
by: Alan Mailer | last post by:
Ok, I'm pretty new to VB.Net, so please bear with me. Imagine the Load event of one of my forms includes the following: Dim ctrl as Control Dim txtbox As TextBox For Each ctrl In Me.Controls...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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,...

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.