Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default UserForm Checkboxes

1. CheckBox Size: I have several checkboxes that are
identical in height and width, and spaced uniformly within
a frame. The actual size of the checkbox "box" varies
slightly from one to the next. The size differences are
small but noticeable. Further the size and "darkness"
(probably change in font size) of the checkmark (when the
box value is true) varies as well, some are smaller
and "light" and some are larger and "dark". I have
fiddled around with heights (making them all one or two
points larger or smaller), locations, etc., but can not
get the boxes to be the same size. What am I doing wrong
here?

2. CheckBox communications: I have several checkboxes in
a frame. I want to limit the user to one selection. Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is this
done?

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm Checkboxes

Private Sub Userform_Initialize()
for each ctrl in Userform1.Frame1.controls
if typeof ctrl is MSforms.Textbox Then
ctrl.Heigth = Userform1.Controls("checkbox1").Height
ctrl.Width = Userform1.Controls("Checkbox1").Width
ctrl.Left = Userform1.Controls("Checkbox1").Left
end if
Next
End Sub

for item 2, use optionbuttons - that is what they do by default.

--
Regards,
Tom Ogilvy

MWE wrote in message
...
1. CheckBox Size: I have several checkboxes that are
identical in height and width, and spaced uniformly within
a frame. The actual size of the checkbox "box" varies
slightly from one to the next. The size differences are
small but noticeable. Further the size and "darkness"
(probably change in font size) of the checkmark (when the
box value is true) varies as well, some are smaller
and "light" and some are larger and "dark". I have
fiddled around with heights (making them all one or two
points larger or smaller), locations, etc., but can not
get the boxes to be the same size. What am I doing wrong
here?

2. CheckBox communications: I have several checkboxes in
a frame. I want to limit the user to one selection. Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is this
done?



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default UserForm Checkboxes

2. CheckBox communications: I have several checkboxes in
a frame. I want to limit the user to one selection. Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is this
done?

Why not use option buttons?


  #4   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default UserForm Checkboxes

that works; thanks

-----Original Message-----
2. CheckBox communications: I have several checkboxes

in
a frame. I want to limit the user to one selection.

Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is this
done?

Why not use option buttons?


.

  #5   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default UserForm Checkboxes

the option buttons work; thanks. But now I have the same
problem with size of the option buttons that I had with
the checkboxes. Your code does not do anything different
than what I had already done manually, i.e., it sets each
height and width equal to the same value. Whether I use
your code (which I tried) or do it manually, I get the
same results, i.e., there are box-to-box or button-to-
button size differences. I am using the default size
(height and width) for both boxes and buttons.

-----Original Message-----
Private Sub Userform_Initialize()
for each ctrl in Userform1.Frame1.controls
if typeof ctrl is MSforms.Textbox Then
ctrl.Heigth = Userform1.Controls

("checkbox1").Height
ctrl.Width = Userform1.Controls("Checkbox1").Width
ctrl.Left = Userform1.Controls("Checkbox1").Left
end if
Next
End Sub

for item 2, use optionbuttons - that is what they do by

default.

--
Regards,
Tom Ogilvy

MWE wrote in message
...
1. CheckBox Size: I have several checkboxes that are
identical in height and width, and spaced uniformly

within
a frame. The actual size of the checkbox "box" varies
slightly from one to the next. The size differences are
small but noticeable. Further the size and "darkness"
(probably change in font size) of the checkmark (when

the
box value is true) varies as well, some are smaller
and "light" and some are larger and "dark". I have
fiddled around with heights (making them all one or two
points larger or smaller), locations, etc., but can not
get the boxes to be the same size. What am I doing

wrong
here?

2. CheckBox communications: I have several checkboxes

in
a frame. I want to limit the user to one selection.

Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is this
done?



.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default UserForm Checkboxes

I did have two typos, one of which reference the size to textbox1 instead of
checkbox1.

Private Sub Userform_Initialize()
For Each ctrl In UserForm1.Frame1.Controls
If TypeOf ctrl Is MSforms.CheckBox Then
ctrl.Height = UserForm1.Controls("checkbox1").Height
ctrl.Width = UserForm1.Controls("Checkbox1").Width
ctrl.Left = UserForm1.Controls("Checkbox1").Left
End If
Next
End Sub

worked fine for me. All the check boxes were the same height and width -
although it didn't correct the spacing between checkboxes - but that wasn't
part of the question.

I am not sure how they can have the same height and width and exhibit the
differences you describe.

--
Regards,
Tom Ogilvy

"MWE" wrote in message
...
the option buttons work; thanks. But now I have the same
problem with size of the option buttons that I had with
the checkboxes. Your code does not do anything different
than what I had already done manually, i.e., it sets each
height and width equal to the same value. Whether I use
your code (which I tried) or do it manually, I get the
same results, i.e., there are box-to-box or button-to-
button size differences. I am using the default size
(height and width) for both boxes and buttons.

-----Original Message-----
Private Sub Userform_Initialize()
for each ctrl in Userform1.Frame1.controls
if typeof ctrl is MSforms.Textbox Then
ctrl.Heigth = Userform1.Controls

("checkbox1").Height
ctrl.Width = Userform1.Controls("Checkbox1").Width
ctrl.Left = Userform1.Controls("Checkbox1").Left
end if
Next
End Sub

for item 2, use optionbuttons - that is what they do by

default.

--
Regards,
Tom Ogilvy

MWE wrote in message
...
1. CheckBox Size: I have several checkboxes that are
identical in height and width, and spaced uniformly

within
a frame. The actual size of the checkbox "box" varies
slightly from one to the next. The size differences are
small but noticeable. Further the size and "darkness"
(probably change in font size) of the checkmark (when

the
box value is true) varies as well, some are smaller
and "light" and some are larger and "dark". I have
fiddled around with heights (making them all one or two
points larger or smaller), locations, etc., but can not
get the boxes to be the same size. What am I doing

wrong
here?

2. CheckBox communications: I have several checkboxes

in
a frame. I want to limit the user to one selection.

Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is this
done?



.



  #7   Report Post  
Posted to microsoft.public.excel.programming
MWE MWE is offline
external usenet poster
 
Posts: 20
Default UserForm Checkboxes

I saw that mistake as I was trying the code. I also
inserted debug statements to make sure the If statement
was triggering correctly. The "before" values for height
and width and the "after" values are the same. And the as
displayed sizes fo the boxes or buttons varies.


-----Original Message-----
I did have two typos, one of which reference the size to

textbox1 instead of
checkbox1.

Private Sub Userform_Initialize()
For Each ctrl In UserForm1.Frame1.Controls
If TypeOf ctrl Is MSforms.CheckBox Then
ctrl.Height = UserForm1.Controls("checkbox1").Height
ctrl.Width = UserForm1.Controls("Checkbox1").Width
ctrl.Left = UserForm1.Controls("Checkbox1").Left
End If
Next
End Sub

worked fine for me. All the check boxes were the same

height and width -
although it didn't correct the spacing between

checkboxes - but that wasn't
part of the question.

I am not sure how they can have the same height and width

and exhibit the
differences you describe.

--
Regards,
Tom Ogilvy

"MWE" wrote in

message
...
the option buttons work; thanks. But now I have the

same
problem with size of the option buttons that I had with
the checkboxes. Your code does not do anything

different
than what I had already done manually, i.e., it sets

each
height and width equal to the same value. Whether I use
your code (which I tried) or do it manually, I get the
same results, i.e., there are box-to-box or button-to-
button size differences. I am using the default size
(height and width) for both boxes and buttons.

-----Original Message-----
Private Sub Userform_Initialize()
for each ctrl in Userform1.Frame1.controls
if typeof ctrl is MSforms.Textbox Then
ctrl.Heigth = Userform1.Controls

("checkbox1").Height
ctrl.Width = Userform1.Controls("Checkbox1").Width
ctrl.Left = Userform1.Controls("Checkbox1").Left
end if
Next
End Sub

for item 2, use optionbuttons - that is what they do by

default.

--
Regards,
Tom Ogilvy

MWE wrote in

message
...
1. CheckBox Size: I have several checkboxes that

are
identical in height and width, and spaced uniformly

within
a frame. The actual size of the checkbox "box"

varies
slightly from one to the next. The size differences

are
small but noticeable. Further the size

and "darkness"
(probably change in font size) of the checkmark (when

the
box value is true) varies as well, some are smaller
and "light" and some are larger and "dark". I have
fiddled around with heights (making them all one or

two
points larger or smaller), locations, etc., but can

not
get the boxes to be the same size. What am I doing

wrong
here?

2. CheckBox communications: I have several

checkboxes
in
a frame. I want to limit the user to one selection.

Thus
if box 1 is selected (value = True), boxes 2, 3 and 4
should automatically have values = False. How is

this
done?



.



.

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default UserForm Checkboxes

I have found a partial solution to the problem with checkboxes o
optionbuttons appearing as different sizes even though the propertie
(height, width, font, etc) were identical. It turns out that th
spacing between boxes or buttons has some influence on box/button size
In my particular case, the box/button HEIGHT is 18. I found that th
spacing between TOPs of sequential objects must be 22 or more. If les
than 22, some elements were undersized but I could find no pattern t
what happens. In some cases, frames with 2 elements did not care abou
spacing – anything worked. In other two element frames, spacing wa
critical. Same for 3, 4, and 5 element frames. My sense is that ther
is an underlying grid that forces elements to be in certain places an
will adjust element size to accommodate the grid. *This is probably
screen resolution issue.* When I have a few minutes, I will fiddl
with spacing and screen resolution and see what that doe

--
Message posted from http://www.ExcelForum.com

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Checkboxes Elaine Excel Discussion (Misc queries) 6 August 20th 09 01:41 AM
Userform Checkboxes gti_jobert Excel Discussion (Misc queries) 1 January 27th 06 01:21 PM
Userform with Checkboxes Greg B Excel Discussion (Misc queries) 5 November 27th 05 09:32 PM
add multiple checkboxes to userform at runtime gkelle Excel Programming 2 October 16th 03 04:16 PM
How to create in a userform, select all/deselect all checkboxes Intruder Excel Programming 1 July 31st 03 04:53 AM


All times are GMT +1. The time now is 10:04 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"