Results 1 to 2 of 2

Thread: Image replacement effect

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2006
    Posts
    98

    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:
    1. Private Sub Image1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    2. If (imageholder2.Visible = True) Then
    3.      imageholder1.Visible = True
    4.      imageholder2.Visible = False
    5.      
    6.    
    7. Else
    8.      imageholder1.Visible = True
    9.      imageholder2.Visible = True
    10.      Call hideAll
    11. End If
    12. End Sub

    And hideAll code:
    VB Code:
    1. Private Sub hideAll()
    2.     txtHelp.Visible = False
    3.     btnFind.Visible = False
    4.     cmbhelpLevel.Visible = False
    5.     cmbHelp.Visible = False
    6.     cmbLA.Visible = False
    7.     cmbType.Visible = False
    8.     cmbLvl.Visible = False
    9.     cmbLOType.Visible = False
    10.     cmbLOCog.Visible = False
    11.     cmbLOAff.Visible = False
    12.     cmbLOPsy.Visible = False
    13. End Sub

    Thanks for any help with this!


  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: Image replacement effect

    you can toggle the visible property of each control by using like
    VB Code:
    1. 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
  •  



Click Here to Expand Forum to Full Width