Bill_Marcy
(Bill Marcy)
January 17, 2020, 8:38pm
1
I have a disclosure triangle on a window, initial state value is off, there is an open and a close event setup, which simply are supposed to
winPrefs.show and winPrefs.hide . (Window called winPrefs).
When running, it always defaults to open. I want it so that it defaults to closed until the disclosure triangle is clicked.
What am I doing wrong?
Let’s start with ‘what are you doing’?
Do you set the state to closed in the Window Open() event?
DO you invalidate the control afterwards?
DerkJ
(DerkJ)
January 17, 2020, 9:36pm
3
In the control.open event windowPrefs.hide or windowPrefs.visible=false ?
Bill_Marcy
(Bill Marcy)
January 17, 2020, 9:55pm
4
DisclosureTriangle.open
winPrefs.show
DisclosureTriangle.close
winPrefs.hide
Bill_Marcy
(Bill Marcy)
January 17, 2020, 9:56pm
5
Jeff:
I do not set the state to closed in the window open event.
I do not invalidate the control afterwards.
Bill_Marcy
(Bill Marcy)
January 17, 2020, 10:09pm
6
Ok, Just for someone else stumbling along at the beginning, here is how I fixed it:
If Me.value Then
//User has opened it.
Dim w As New winPrefs
w.show
w.top = Self.top + Me.top
w.Left = Self.Left + Self.width
Else
//User has closed it.
For i As Integer = 0 To WindowCount-1
If Window(i) IsA winPrefs Then
Window(i).close
End
Next
End
[quote=471811:@Bill Marcy]DisclosureTriangle.open
winPrefs.show
DisclosureTriangle.close
winPrefs.hide[/quote]
These events are not what you’re assuming they are. For more information, check out the documentation on both events:
Close event
Open event
With just a little more exploration, you’ll find you want the Action event to handle the window state.