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

Checkboxes and Shadowing, Unshadowing, Highlighting

I have a main form containing 2 checkboxes.

The respective checkboxes when checked cause the SepcialEffect
Property to make all the textboxes to appear Shadowed.

1)Although the Textboxes and Combo Boxes required to appear Shadowed
are almost the same regardless of the checkbox that is checked how do
I cause individual textboxes to appear Flat?

2)How do I cause the Textboxes and Combo Boxes to highlight upon
checking the respective checkbox?

Here is my code:

Private Sub ChckIBCCP_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And ChckIBCCP = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub

Private Sub ChckOtherReferral_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And ChckOtherReferral = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub

Thanks,
John
Jun 27 '08 #1
1 2230
zufie wrote:
I have a main form containing 2 checkboxes.

The respective checkboxes when checked cause the SepcialEffect
Property to make all the textboxes to appear Shadowed.

1)Although the Textboxes and Combo Boxes required to appear Shadowed
are almost the same regardless of the checkbox that is checked how do
I cause individual textboxes to appear Flat?

2)How do I cause the Textboxes and Combo Boxes to highlight upon
checking the respective checkbox?

Here is my code:

Private Sub ChckIBCCP_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And ChckIBCCP = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub

Private Sub ChckOtherReferral_Click()
Dim ctl As Control
For Each ctl In Me.Controls
If ctl.Tag = "Shadow1" And ChckOtherReferral = True _
And ctl.ControlType = 109 Then
ctl.SpecialEffect = 4
ElseIf ctl.Tag <"Shadow1" And ctl.ControlType _
= acTextBox Then
ctl.SpecialEffect = 1
End If
Next
End Sub

Thanks,
John
Realize if a textbox the ControlType value is 109. AcTextBox is also
109. So you are excluding everything but textboxes.

OK...first I'd create an Option Group. Find that control on the
toolbox. Create 2 checkboxes for that option group. ChckIBCCP = 1,
ChckOtherReferral = 2

With an option group it's going to either be one of the checkboxes or
the other. You can combine your two subs into one sub.

Now, put in the word Shadow1 for the tag property of all those controls
you want affected with ChckIBCCP. Leave all others blank.

Private Sub FrameSelection_Click()

Dim ctl As Control 'for looping.

For Each ctl In Me.Controls
If ctl.ControlType = acTextBox Or _
ctl.ControlType = acComboBox Then
'its a text box or combo box.

If Me.FrameSelection = 1 Then
'ChckIBCCP selected
ctl.SpecialEffect = IIf(ctl.Tag = "Shadow1", 4, 1)
Else
ctl.SpecialEffect = IIf(ctl.Tag <"Shadow1", 4, 1)
End If
End If
Next

End Sub

For the FrameSelection, I set the default to the ChckIBCCP value (or 1).
I can then call the next sub in the OnOpen or OnCurrent event if needed.
Private Form_Current()
FrameSelection_Click
End Sub

Golosa
http://www.youtube.com/watch?v=tY8uU0PFFb0
Jun 27 '08 #2

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

Similar topics

9
by: Jay Davis | last post by:
I use xemacs and syntax highlighting for my IDE, but I'm not a big fan of the default syntax highlighting colors. For instance, in 'def fun():' both 'def' and 'fun' are the same color. I kind of...
3
by: Aguilar, James | last post by:
Hey all. I was making a newbie mistake that I eventually figured out. That is not my question. My question is about the error message. So let me set the stage for you: class Superclass {...
20
by: PC Datasheet | last post by:
How can the label for a checkbox and the labels for the options in an option group be addressed? When a checkbox gets the focus, Access draws a dotted box around the label. When an option group...
4
by: Bob hotmail.com> | last post by:
Everyone I have been spending weeks looking on the web for a good tutorial on how to use regular expressions and other methods to satisfy my craving for learning how to do FAST c-style syntax...
3
by: Nick Stansbury | last post by:
Hi, Quick (and probably simple) question regarding shadowing and polymorphism. Problem is best explained by an example. Public Class A public CommonProperty as Integer end class Public...
5
by: Dave Taylor | last post by:
I'm trying to derive a class from a typed DataSet to add some methods to one of the DataTables. I would like to keep the names the same in the derived class as in the base class, so I have used...
2
by: David Garamond | last post by:
Is there a feature similar to this currently in Postgres, or will there be? Sometimes (like in a shared hosting environment), we cannot have the luxury of hot-swapped RAID or expensive SAN, and...
2
by: rockstar_ | last post by:
Hello all- I'm developing a Content Management software for my own site, and possibly package and deploy to other sites (for friends, family, etc.) The content management software is combined...
7
by: rn5a | last post by:
The first column of a DataGrid has a CheckBox for all the rows. I want that when users check a CheckBox, the BackColor of that entire row in the DataGrid should change to a different color. To...
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: 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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...

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.