Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA control vscroll and hscroll in a frame
I Sent the file to your mailbox.
Regards, Karim |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Use VBA to control scrollbars in a Frame | Excel Programming | |||
user form and frame control | Excel Programming | |||
tab order in frame control | Excel Programming | |||
userform frame control | Excel Programming | |||
Missing ActiveX Frame control in Excel 2000 | Excel Programming |