473,796 Members | 2,601 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Attaching a label to a BOX

Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of
clickable areas, and I want each one to have a label. No problem, just put
'em on, right? But I also want the box/label combination to act as a single
item when clicked - that is, not have to put the same OnClick code on both
the box and the label (or force the user to click on the background only).
I've tried attaching the label to the box (by cutting the label then
highlighting the box and pasting it) to try to make the text clickable, like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando
Nov 13 '05 #1
6 1870
Armando -

This is a trick that works in Access 97 and probably A2K also.

Highlight the label and cut it to the clipboard (Ctl-X). Then highlight the control and paste
(Ctl-V).

The label will come back and will be attached to the control that you highlighted.

- Brian
Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of
clickable areas, and I want each one to have a label. No problem, just put
'em on, right? But I also want the box/label combination to act as a single
item when clicked - that is, not have to put the same OnClick code on both
the box and the label (or force the user to click on the background only).
I've tried attaching the label to the box (by cutting the label then
highlighting the box and pasting it) to try to make the text clickable, like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando


(Remove NOSPAM to reply.)
Nov 13 '05 #2
Armando -

Sorry for the wasted post, I overlooked the last sentence of your first paragraph. Apparently
rectangle controls don't know about labels...

- Brian
Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of
clickable areas, and I want each one to have a label. No problem, just put
'em on, right? But I also want the box/label combination to act as a single
item when clicked - that is, not have to put the same OnClick code on both
the box and the label (or force the user to click on the background only).
I've tried attaching the label to the box (by cutting the label then
highlightin g the box and pasting it) to try to make the text clickable, like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando


(Remove NOSPAM to reply.)


(Remove NOSPAM to reply.)
Nov 13 '05 #3

"Armando" <ar*****@bogusa ddress.com> wrote in message
news:Kw******** **********@news 1.epix.net...
Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of
clickable areas, and I want each one to have a label. No problem, just
put
'em on, right? But I also want the box/label combination to act as a
single
item when clicked - that is, not have to put the same OnClick code on both
the box and the label (or force the user to click on the background only).
I've tried attaching the label to the box (by cutting the label then
highlighting the box and pasting it) to try to make the text clickable,
like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando

Here is one possibilty to handle this sort of thing - this form has two
box/label combinations:

Private Sub HandleClick(str Box As String)

Select Case strBox

Case "One"
MsgBox "Do this!"

Case "Two"
MsgBox "Do that!"

Case Else
MsgBox "Do what?"

End Select

End Sub

Private Sub boxOne_Click()
HandleClick "One"
End Sub

Private Sub lblOne_Click()
HandleClick "One"
End Sub

Private Sub boxTwo_Click()
HandleClick "Two"
End Sub

Private Sub lblTwo_Click()
HandleClick "Two"
End Sub
Nov 13 '05 #4
Have a look at Stephen Lebans (http://www.lebans.com) cmdbutton. As far as I
remember that allows coloured command buttons with labels

HTH

Phil
"Armando" <ar*****@bogusa ddress.com> wrote in message
news:Kw******** **********@news 1.epix.net...
Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of
clickable areas, and I want each one to have a label. No problem, just
put
'em on, right? But I also want the box/label combination to act as a
single
item when clicked - that is, not have to put the same OnClick code on both
the box and the label (or force the user to click on the background only).
I've tried attaching the label to the box (by cutting the label then
highlighting the box and pasting it) to try to make the text clickable,
like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando

Nov 13 '05 #5
Hi Justin -

Yup, this is exactly what I'm doing now, just send the same call from both
the box and the label, then do the actual work in the called sub, after
deciding what was clicked. I was hoping to get this down to a single call
from each box, mostly to make it more generalizable for users who have a
different physical-metaphor map. But this isn't THAT bad - thanks for the
second opinion.

Armando

"Justin Hoffman" <j@b.com> wrote in message
news:d3******** **@hercules.bti nternet.com...

"Armando" <ar*****@bogusa ddress.com> wrote in message
news:Kw******** **********@news 1.epix.net...
Hey gurus -

Access 2000 - I have a form with a series of box controls forming a map of clickable areas, and I want each one to have a label. No problem, just
put
'em on, right? But I also want the box/label combination to act as a
single
item when clicked - that is, not have to put the same OnClick code on both the box and the label (or force the user to click on the background only). I've tried attaching the label to the box (by cutting the label then
highlighting the box and pasting it) to try to make the text clickable,
like
checkboxes and option buttons work, but they don't stick together.

I can't make the boxes into command buttons, because I need to set the
bgcolor of each one to show its status. I suppose I could use cb's with
colored captions, but it's not as visually intuitive.

Ideas?

Armando

Here is one possibilty to handle this sort of thing - this form has two
box/label combinations:

Private Sub HandleClick(str Box As String)

Select Case strBox

Case "One"
MsgBox "Do this!"

Case "Two"
MsgBox "Do that!"

Case Else
MsgBox "Do what?"

End Select

End Sub

Private Sub boxOne_Click()
HandleClick "One"
End Sub

Private Sub lblOne_Click()
HandleClick "One"
End Sub

Private Sub boxTwo_Click()
HandleClick "Two"
End Sub

Private Sub lblTwo_Click()
HandleClick "Two"
End Sub

Nov 13 '05 #6
Phil -

This always seems to be the answer to questions like this, and I STILL
forget to do it first. Thanks, I'll look there.

Armando

"Phil Stanton" <ph******@xxsta ntonfamily.co.u k> wrote in message
news:42******** *************@p tn-nntp-reader04.plus.n et...
Have a look at Stephen Lebans (http://www.lebans.com) cmdbutton. As far as I remember that allows coloured command buttons with labels

HTH

Phil


Nov 13 '05 #7

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

Similar topics

6
2172
by: .: DeVa :. | last post by:
How can i brows for picture on disk and then save it into array for mailing ? ------ www.podvodni-svijet.com "Half-brother in blood, full brother in heart will I be. Thou shalt lead and I will follow. May no new grief divide us."
1
3246
by: Ravi | last post by:
Q1.)In SQL Server 2000, is it always possible to use copies of the data and transaction log files of a database from one server to reattach to a new database on another server, or even to the same server, without first detaching from the existing database? Books Online says that detaching a database closes the data and log files cleanly. I read some where that some times, it is possible to attach without detaching, if the data and log...
6
9940
by: Yvan J. Gagnon | last post by:
I am currenly developing a web site using Macromedia fireworks, and am trying to figure out a way (through hand-coding) of attaching a javascript function (onClick="doit=false") to each of the links in my fireworks-generated dhtml popup menus. Does anyone here know where I would add this javascript fucntion in the code so that it would be recognized? And do I do it in the html, or in the JS file? The javascript function I need to add is...
1
4718
by: Mark Kamoski | last post by:
Hi-- All of sudden (?) the VS.NET v1 IDE is NOT automatically attaching aspnet_wp.exe as a debugged process. Why? Here is the situation. VS.NET (v1)
1
1319
by: wh | last post by:
This is more a question of style really, nothing too technical - honest. My question is what is the preferred way of defining the styles of elements in an asp.net page? Supposing I have several *Web* controls (i.e. <asp:label> elements) that I want to apply a formatting style to. The first method would be to select all controls in page design view then set the appearance properties in the properties window. The other method would be to...
3
2896
by: Shiva | last post by:
Hi, When you create a combobox on a form, both a label and a combobox are created. This label doesn't have the same properties as a label detached from a combobox. For example, the property 'hyperlinkadres' is a property of a label that doesn't belong to a combobox. But this property isn't a property of the label belonging to a combobox. Now here's my problem: I once deleted the labels being belonging to the corresponding combobox....
0
1536
by: Kevin McKinley | last post by:
Below i've put the code for a program that i wrote. I need help on lines 384-403. If you run this program you will notice on the first tab when have it produce an answer the $ is surrounded with {$}. How can i get rid of that? from Tkinter import * class MyApp: def __init__(self, parent): self.myparent = parent
0
1514
by: Guilherme Polo | last post by:
On Wed, Sep 3, 2008 at 8:57 PM, Kevin McKinley <kem1723@yahoo.comwrote: Come on.. "help on lines 384-403", that is not a good way to look for help. You are supposed to post some minimal code that demonstrates the problem. Anyway, this demonstrates what you are getting (independent of python version): import Tkinter
1
1769
by: moltendorf | last post by:
I have a simple XMLHttpRequest that grabs a list of messages from my server (I posted a question for a different aspect of this earlier) I have decided to improve on it a little by adding in things that my message logger does (server-side) to turn things like: http://www.example.com or: http://example.com into URLs automatically by slapping on <a href="http://www.example.com" target="_blank">www.example.com</a> when: www.example.com
0
9685
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10237
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10187
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10018
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5446
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3735
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.