|
-
Oct 26th, 2006, 07:49 AM
#1
Thread Starter
Lively Member
Image replacement effect
Hi all,
Im having a slight problem with a section of my VBA project.
This may be a little confusing but ill try explain as simple as possible..
I have a form that contains two images(In image holders) and a 'switch button'.
When the switch button is pressed the images switch between each other creating a minimized/maximized effect.
When one image is 'minimized' all the textboxes,buttons etc.. on the form become invisible. and the objects on the now 'maximized' form are visible and vica versa.
The problem is that i want the information (textbox info, comboxes) to be displayed the same in the window before it was minimized.
So i want the 'maximized' form to remember the information and show that exact same information when it is maximized again.
I know this is pretty hard to understand but i had to do it this way as VBA cannot use the standard window minimize feature of MDI controls.
the code i am using to switch the images creating the minimized/maximze effect is:
VB Code:
Private Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If (imageholder2.Visible = True) Then
imageholder1.Visible = True
imageholder2.Visible = False
Else
imageholder1.Visible = True
imageholder2.Visible = True
Call hideAll
End If
End Sub
And hideAll code:
VB Code:
Private Sub hideAll()
txtHelp.Visible = False
btnFind.Visible = False
cmbhelpLevel.Visible = False
cmbHelp.Visible = False
cmbLA.Visible = False
cmbType.Visible = False
cmbLvl.Visible = False
cmbLOType.Visible = False
cmbLOCog.Visible = False
cmbLOAff.Visible = False
cmbLOPsy.Visible = False
End Sub
Thanks for any help with this!
-
Oct 27th, 2006, 11:23 PM
#2
Re: Image replacement effect
you can toggle the visible property of each control by using like
VB Code:
cmbLOPsy.Visible= Not cmbLOPsy.Visible
the contros should retain there values so when they are displayed again, they will still be the same as before,
if the image is displayed on top of the other controls are they hidden anyway?
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|