Resizing stacked controls (1 Viewer)

steve1111

Registered User.
Local time
Today, 12:29
Joined
Jul 9, 2013
Messages
170
Hello,

I have several labels, text boxes and list boxes on a form all arranged stacked. This is a filter form. I have all the labels where if you click + button then that category's filters grow from a height of 0.0007 to 0.20 and when you hit - shrink back to 0.0007. The code is working ok to expand and collapse the fields, but when I collapse and the rest of the subsequent controls move up, but my issue is it is messing up the borders of the other controls and it looks choppy and glitchy, like one box is on top of the other.

Is there any way to clean this up? it only does it when things are collapsing, they expand and shift without and visual issues.

Thanks
 

static

Registered User.
Local time
Today, 17:29
Joined
Nov 2, 2015
Messages
823
"I did this thing but looks weird" doesn't explain what you did or why/how it looks weird.

Please upload some example images / code / database.

Ta.
 

steve1111

Registered User.
Local time
Today, 12:29
Joined
Jul 9, 2013
Messages
170
Ok, I have added a side by side comparison attached. When I collapse the text boxes under the Supervisor lbl that is when the formatting gets weird. All the controls are stacked so I am just adjusting the height of some.

Code:
Private Sub lblSupervisors_Click()

If left(Me.lblSupervisors.Caption, 1) = "+" Then
    'Show the filters
    Me.schSupervisors.Height = 1440 * 0.2
    Me.lbxSupervisors.Height = 1440 * 0.6
    
    Me.schSupervisors.BorderStyle = 1
    Me.lbxSupervisors.BorderStyle = 1
    
    Me.lblSupervisors.Caption = "- Supervisor(s)"
    Me.Form.Refresh
    
Else
    'Hide the filters
    Me.schSupervisors.Height = 1440 * 0.0007
    Me.lbxSupervisors.Height = 1440 * 0.0007
    
    Me.schSupervisors.BorderStyle = 0
    Me.lbxSupervisors.BorderStyle = 0
    
    Me.lblSupervisors.Caption = "+ Supervisor(s)"
    Me.Form.Refresh
End If

End Sub
 

Attachments

  • ContolViewingIssue.JPG
    ContolViewingIssue.JPG
    39.8 KB · Views: 90

Users who are viewing this thread

Top Bottom