Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default VBA control vscroll and hscroll in a frame

I need to be able to position the vertical and horizontal scroll bars in a
Fame object from VBA. I have searched the internet for an API or code o do
this without success. The only frame routine (scroll) doesn't seem to do
this. Any help would be appreciated.

Gary

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA control vscroll and hscroll in a frame

Hi Gary,

I am not sure I got your point, but you can use the ScrollTop
(Vertical) and ScrollWidth (Horizontal) property to position them. Of
course, you should know the values (in design mode) to do so and also
you should set the Setfocus method to the adjacent object (textbox,
command button, checkbox, etc).

myFrame.ScrollTop = 1176
myFrame.ScrollWidth = 600
myTextBox.SetFocus

I hope this helps.
Karim

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA control vscroll and hscroll in a frame

Please use scrollLeft and not scrollWidth.

ScrollWidth set the width limit for the Frame and ScrollHeight the
height limit.

Regards,
Karim

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default VBA control vscroll and hscroll in a frame

Karim,

I have a WebBrowserObject in a Frame and I need to be able to control from
VBA the position of the scrollbars so the WebBrowser shows what I want. The
scrollbars in the Frame do not appear to be controllable from a VB
application unlike scroll bars you can add to an object. If I try to add my
own scrollbars to the frame it has no affect on the WebBrowser. Hope that
makes sense.

Gary


" wrote:

Hi Gary,

I am not sure I got your point, but you can use the ScrollTop
(Vertical) and ScrollWidth (Horizontal) property to position them. Of
course, you should know the values (in design mode) to do so and also
you should set the Setfocus method to the adjacent object (textbox,
command button, checkbox, etc).

myFrame.ScrollTop = 1176
myFrame.ScrollWidth = 600
myTextBox.SetFocus

I hope this helps.
Karim


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA control vscroll and hscroll in a frame

Hello again,

I made an example where you can see how you can programmatically
control the scrollbars in a Frame1. I think this would be better. If
you wish I can send it to your email address.

Regards,
Karim



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 273
Default VBA control vscroll and hscroll in a frame

karim,

I would be very grateful to see a real example. Please do send to my email
address.

Thanks for your interest,

gary

" wrote:

Hello again,

I made an example where you can see how you can programmatically
control the scrollbars in a Frame1. I think this would be better. If
you wish I can send it to your email address.

Regards,
Karim


  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA control vscroll and hscroll in a frame

Is this your email -- gary @ discussions . microsoft . com (I added
the spaces as an anti spamming precaution) ?

  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default VBA control vscroll and hscroll in a frame

I Sent the file to your mailbox.

Regards,
Karim

  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA control vscroll and hscroll in a frame

Hello,

For the benefit of all, here is a description of the program that
worked for Gary.

Create a UserForm1 and add the following objects to it:

A Frame name it as Frame1 with ScrollHeight = 300 and ScrollWidth = 480
A Slider name it as SliderV with Max = 300
A Slider name it as SliderH with Max = 480
A Label name it as V
A Label name it as H

In the code area of the UserForm1 paste the following code:
Private Sub SliderH_Change()
Frame1.ScrollLeft = SliderH.Value
H.Caption = SliderH.Value
End Sub

Private Sub SliderV_Change()
Frame1.ScrollTop = SliderV.Value
V.Caption = SliderV.Value
End Sub

Now, you can control the Frame1 scrollbars using the sliders.

Regards,
Karim

  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default VBA control vscroll and hscroll in a frame

Hello,

For the benefit of all, here is a description of the program that
worked for Gary.

Create a UserForm1 and add the following objects to it:

A Frame name it as Frame1 with ScrollHeight = 300 and ScrollWidth = 480
A Slider name it as SliderV with Max = 300
A Slider name it as SliderH with Max = 480
A Label name it as V
A Label name it as H

In the code area of the UserForm1 paste the following code:
Private Sub SliderH_Change()
Frame1.ScrollLeft = SliderH.Value
H.Caption = SliderH.Value
End Sub

Private Sub SliderV_Change()
Frame1.ScrollTop = SliderV.Value
V.Caption = SliderV.Value
End Sub

Now, you can control the Frame1 scrollbars using the sliders.

Regards,
Karim

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
Use VBA to control scrollbars in a Frame gary Excel Programming 0 May 26th 06 10:17 PM
user form and frame control Gixxer_J_97[_2_] Excel Programming 1 February 11th 05 10:26 PM
tab order in frame control mike Excel Programming 2 February 19th 04 03:42 PM
userform frame control Jo[_4_] Excel Programming 2 September 20th 03 12:38 AM
Missing ActiveX Frame control in Excel 2000 Judy Hopkins Excel Programming 0 July 30th 03 10:40 PM


All times are GMT +1. The time now is 01:14 PM.

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"