[RESOLVED] need help with something simple i just cant figure it out
ok i have 5 buttons as like a menu and sub menus below them when i click a button in the menu i want it to roll down i know i can do it with a timer but i dont want to use a timer for every sub menu
kind of like a flash menu
Re: need help with something simple i just cant figure it out
Re: need help with something simple i just cant figure it out
i want to do it without using a timer though if you know how please help ..... i have a few picture boxes as sub menus they are different heights
Re: need help with something simple i just cant figure it out
What about using a loop and sleep api ?
Re: need help with something simple i just cant figure it out
I had updated My code bank submission... Have a look at them... The second method used is, WHILE loop and SLEEP Api
Re: need help with something simple i just cant figure it out
i can do that but how about if the sub menus are different hegiths?
Re: need help with something simple i just cant figure it out
Ok... that's also updated in my code.... :)
Re: need help with something simple i just cant figure it out
Re: need help with something simple i just cant figure it out
what do i have wrong? i have the menu but i want the form to resize along with the menu like get bigger and smaller and have a picture box go along with the menu also like i hit the menu a sub menu slides out and a picture stays at the botton of the menu and the form resizes to hold it get what im saying? heres the code
Code:
Sub MnuScroLl(Frm As Form, Pc As PictureBox, MinPc As Integer, MaxPc As Integer, MinFrm As Integer, MaxFrm As Integer, BrUp As Integer, BrDown As Integer)
If Pc.Tag = "opened" Then
While Pc.Height > MinPc
Pc.Height = Pc.Height - 40
Frm.Height = Frm.Height - 40
FrmMain.Picture1.Top = FrmMain.Picture1.Top - 40
DoEvents
Sleep 5
Wend
Pc.Tag = "closed"
Frm.Height = MinFrm
FrmMain.Picture1.Top = BrDown
Else
While Pc.Height < MaxPc
Pc.Height = Pc.Height + 40
Frm.Height = Frm.Height - 40
FrmMain.Picture1.Top = FrmMain.Picture1.Top + 40
DoEvents
Sleep 5
Wend
Pc.Tag = "opened"
Frm.Height = MaxFrm
FrmMain.Picture1.Top = BrUp
End If
End Sub
Re: need help with something simple i just cant figure it out
i got ittttttttttt yay
heres the code i used
i did remove the sleep function though made it go smoother i think
Code:
Sub MnuScroLl(Frm As Form, Pc As PictureBox, MinPc As Integer, MaxPc As Integer, MinFrm As Integer, MaxFrm As Integer, BrUp As Integer, BrDown As Integer)
If Pc.Tag = "opened" Then
While Pc.Height > MinPc
Pc.Height = Pc.Height - 40
Frm.Height = Frm.Height - 40
FrmMain.Picture1.Top = FrmMain.Picture1.Top - 40
DoEvents
Wend
Pc.Visible = False
Pc.Tag = "closed"
Frm.Height = MinFrm
FrmMain.Picture1.Top = BrUp
Else
While Pc.Height < MaxPc
Pc.Height = Pc.Height + 40
Frm.Height = Frm.Height + 40
FrmMain.Picture1.Top = FrmMain.Picture1.Top + 40
DoEvents
Wend
Pc.Visible = True
Pc.Tag = "opened"
Frm.Height = MaxFrm
FrmMain.Picture1.Top = BrDown
End If
End Sub
thanks for the help man
Re: [RESOLVED] need help with something simple i just cant figure it out
Quote:
thanks for the help man
welcome :)