Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I created a form with user instructions on how to work with key-combinations in excel and saved it as an xla. The form pops up on key ctrl+shift+X. The form covers more or less the complete monitor-window (especially on monitors of 15" or less). Now I would like to place a scroll-bar on the form, which would it possible to show only an small part of the form. I placed a scroll-bar on the form, but I can't figure out what the code should be to have the form scrolling in its window. Does anyone have any suggestions? Any help is greatly appreciated. Sybolt |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There are properties for the UserForm.
Try playing with ScrollBars = fmScrollBarsBoth ScrollHeight = 5000 ScrollWidth = 5000 Then at design time, you can place controls outside of the visible area by using the scrollbars. -- Rob van Gelder - http://www.vangelder.co.nz/excel "S.Hoitinga" wrote in message ... Hi, I created a form with user instructions on how to work with key-combinations in excel and saved it as an xla. The form pops up on key ctrl+shift+X. The form covers more or less the complete monitor-window (especially on monitors of 15" or less). Now I would like to place a scroll-bar on the form, which would it possible to show only an small part of the form. I placed a scroll-bar on the form, but I can't figure out what the code should be to have the form scrolling in its window. Does anyone have any suggestions? Any help is greatly appreciated. Sybolt |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You may want to look at using a multipage control, too.
You could make it look a lot like the Tools|options dialog (well, except with yours, you could find what you're looking for <vbg) "S.Hoitinga" wrote: Hi, I created a form with user instructions on how to work with key-combinations in excel and saved it as an xla. The form pops up on key ctrl+shift+X. The form covers more or less the complete monitor-window (especially on monitors of 15" or less). Now I would like to place a scroll-bar on the form, which would it possible to show only an small part of the form. I placed a scroll-bar on the form, but I can't figure out what the code should be to have the form scrolling in its window. Does anyone have any suggestions? Any help is greatly appreciated. Sybolt -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Private Sub UserForm_Initialize()
Me.ScrollBars = fmScrollBarsVertical Me.ScrollHeight = Me.Height Me.Height = 0.5 * Me.Height End Sub -- Regards, Tom Ogilvy "S.Hoitinga" wrote in message ... Hi, I created a form with user instructions on how to work with key-combinations in excel and saved it as an xla. The form pops up on key ctrl+shift+X. The form covers more or less the complete monitor-window (especially on monitors of 15" or less). Now I would like to place a scroll-bar on the form, which would it possible to show only an small part of the form. I placed a scroll-bar on the form, but I can't figure out what the code should be to have the form scrolling in its window. Does anyone have any suggestions? Any help is greatly appreciated. Sybolt |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks everybody,
I used a combination of Tom's and Rob's suggestions. like this: Private Sub UserForm_Initialize() Me.ScrollBars = fmScrollBarsVertical Me.ScrollHeight = 400 Me.Height = 0.3 * Me.Height End Sub A new problem occurred however. When the form pops up it focuses on the vertical end of the form, where I would like the form to focus on the vertical top of the form. Has this anything to do with a command button, which is at the end of the form? This button has the focus (automatically) because I want users to be able to push Enter to close the form? greets, Sybolt |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
From what I can gather, this has to do with the TabIndex property.
The form can be navigated by keyboard using the tab key. Each control has a TabIndex which sequences which control gets focus as Tab is pressed. -- Rob van Gelder - http://www.vangelder.co.nz/excel "S.Hoitinga" wrote in message ... Thanks everybody, I used a combination of Tom's and Rob's suggestions. like this: Private Sub UserForm_Initialize() Me.ScrollBars = fmScrollBarsVertical Me.ScrollHeight = 400 Me.Height = 0.3 * Me.Height End Sub A new problem occurred however. When the form pops up it focuses on the vertical end of the form, where I would like the form to focus on the vertical top of the form. Has this anything to do with a command button, which is at the end of the form? This button has the focus (automatically) because I want users to be able to push Enter to close the form? greets, Sybolt |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() "Rob van Gelder" wrote From what I can gather, this has to do with the TabIndex property. The form can be navigated by keyboard using the tab key. Each control has a TabIndex which sequences which control gets focus as Tab is pressed. That's just what my idea was. I tried to give the first object (a lable) the first tab-key, but this didn't change a thing. Also I set the property "setfocusonclick" of the comandbutton to false, but still the focus was on the end of the form. I don't want people to first use the Tab to get to the top of the form. The form should show the top when popping up. It seems to be out of control. Weird. |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Each control has their own TabIndex. Ensure that the top-most control has
the lowest TabIndex number. -- Rob van Gelder - http://www.vangelder.co.nz/excel "S.Hoitinga" wrote in message .. . "Rob van Gelder" wrote From what I can gather, this has to do with the TabIndex property. The form can be navigated by keyboard using the tab key. Each control has a TabIndex which sequences which control gets focus as Tab is pressed. That's just what my idea was. I tried to give the first object (a lable) the first tab-key, but this didn't change a thing. Also I set the property "setfocusonclick" of the comandbutton to false, but still the focus was on the end of the form. I don't want people to first use the Tab to get to the top of the form. The form should show the top when popping up. It seems to be out of control. Weird. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Scrollbar help | Excel Discussion (Misc queries) | |||
scrollbar reslut makes another scrollbar to show | Excel Discussion (Misc queries) | |||
Excel VBA - Userform Texbox/Scrollbar problem | Excel Programming | |||
Scrollbar | Excel Programming | |||
Scrollbar settings in a UserForm | Excel Programming |