Hello,
I want to scrool the frame using Horizontal scroll Bar.
Please look at the form attached.
If user want to add more than 10 items
then he scroll down and add more item.
Can anybody give me some input for coding.
Thanx in advance,
Champgary :)
Printable View
Hello,
I want to scrool the frame using Horizontal scroll Bar.
Please look at the form attached.
If user want to add more than 10 items
then he scroll down and add more item.
Can anybody give me some input for coding.
Thanx in advance,
Champgary :)
have one more frame inside the main frame and have the scroll bars on the main frame and controls on the inside frame. according to the scroll bar move the controls frame... this works...
I try to use code by martinliss...
but something going wrong can anybody help me to solve
I have attached updated form.
Try this in your Form_Load event..
And this in VScroll1_ChangeVB Code:
Private Sub Form_Load() VScroll1.Height = PicWindow.Height VScroll1.Min = PicWindow.Top VScroll1.Max = PicWindow.Height VScroll1.SmallChange = 100 VScroll1.LargeChange = PicPicture.Height End Sub
VB Code:
Private Sub VScroll1_Change() PicWindow.Top = -VScroll1.Value End Sub
oooppss...I put your code but now when I scroll picture box is vanishing. :confused:
In martinliss code he is doing the same thing
here is his code.
Can you tell why this is not working for me :cry:
Did you add that VScroll1_Change event I added in my previous post?
Also, Inside MartinLiss sub Change all PicPicture with PicWindow and it will work.
Also make KeyPreview = true for your Form.
the main problem is that you are not using the correct names for each picturebox, picWindow should be PicPicture and Picpicture should be PicWindow
Here is the code
And now I'll see Martinliss code you posted :DVB Code:
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) CheckKeyCode KeyCode End Sub Private Sub Form_Load() VScroll1.Height = PicWindow.Height VScroll1.Min = PicWindow.Top VScroll1.Max = PicWindow.Height VScroll1.SmallChange = 100 VScroll1.LargeChange = PicPicture.Height Me.KeyPreview = True End Sub Private Sub VScroll1_Change() PicWindow.Top = -VScroll1.Value End Sub Public Sub CheckKeyCode(KeyCode As Integer) '*************************************************************************** 'Purpose: Intercept and act on special keys on me so ' that up and down arrows and scroll bar works as expected. Also ' automatically scroll screen when Tab key would otherwise disappear ' off the screen. 'Inputs: KeyCode - The ASCII(?) value of the key pressed 'Outputs: None '*************************************************************************** Dim nScrollValue As Double Dim nOnePage As Integer nOnePage = Me.VScroll1.Height If KeyCode = vbKeyPageUp Or KeyCode = vbKeyPageDown Then If KeyCode = vbKeyPageDown Then nScrollValue = -Me.PicWindow.Top + nOnePage Else nScrollValue = -Me.PicWindow.Top - nOnePage End If 'Make sure that the scroll bar 'handle' is not attempted to be positioned 'below the bottom of the scroll bar. If nScrollValue > Me.VScroll1.Max Then nScrollValue = Me.VScroll1.Max Me.PicWindow.Top = -Me.VScroll1.Max End If If nScrollValue > 0 Then Me.VScroll1.Value = nScrollValue Else Me.VScroll1.Value = 0 End If End If End Sub
Ok, saw ML code, with the code I posted here your app is doing exactly the same, at least here. :)
:wave: THANKS JCIS,
You solved this, perhaps I missed out something.
Thanks for your help :D
hi champ ...
try this, hope this solved your problem ...
and, my pm to you is has not been answered yet. :)
HI LeonX,
:wave:
Thanks alot. :bigyello:
It looks quite smart :cool:
I can scroll frame itself.
That is what I really want.