Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default scrollbar on userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default scrollbar on userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default scrollbar on userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default scrollbar on userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default scrollbar on userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default scrollbar on userform

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default scrollbar on userform


"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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default scrollbar on userform

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
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
Scrollbar help [email protected] Excel Discussion (Misc queries) 1 January 19th 07 10:48 PM
scrollbar reslut makes another scrollbar to show Patrik Excel Discussion (Misc queries) 0 April 18th 05 03:11 PM
Excel VBA - Userform Texbox/Scrollbar problem thesteelmaker[_5_] Excel Programming 2 March 6th 04 09:09 PM
Scrollbar stewatr Excel Programming 0 November 28th 03 04:57 PM
Scrollbar settings in a UserForm mohsinb[_5_] Excel Programming 2 November 9th 03 06:04 PM


All times are GMT +1. The time now is 12:17 AM.

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

About Us

"It's about Microsoft Excel"