Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Checkboxes | Excel Discussion (Misc queries) | |||
Userform Checkboxes | Excel Discussion (Misc queries) | |||
Userform with Checkboxes | Excel Discussion (Misc queries) | |||
add multiple checkboxes to userform at runtime | Excel Programming | |||
How to create in a userform, select all/deselect all checkboxes | Excel Programming |