|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Problem with modified Combobox classWhen set to ReadOnly, the combobox can't be changed, but it doesn't appear gray. I called the new class ComboLockBox and I've placed them on a MDIChild form and they work great. The problem is, I got a timer that looks for mouse activity and when the mouse is idle for a set number of minutes, all MDIChild forms are hidden and the Logon form is displayed. When the user logs back on, the visible property of the forms is set back to True. The ComboLockBox controls are no longer the modified class I created, but are regular comboboxes and are grayed out. Setting my ReadOnly property or the Enabled property of the boxes doesn't change anything. What's happening to my class? Here's the code I use to hide the forms: Try For j = 0 To (Me.MdiChildren.Length) - 1 Dim tempChild As Form = CType(Me.MdiChildren(j), Form) tempChild.Visible = False Next For i As Integer = 0 To My.Application.OpenForms.Count - 1 If My.Application.OpenForms(i).Name <> "frmMain" Then My.Application.OpenForms(i).Visible = False End If Next Catch MsgBox(Err.Description, MsgBoxStyle.Critical, "AN ERROR OCCURRED WHILE HIDING THE FORMS") 'do nothing End Try and this unhides the forms: Dim m As System.Windows.Forms.Form For Each m In My.Application.OpenForms If m.Name <> "frmMain" Then m.Visible = True End If Next m For j = 0 To (Me.MdiChildren.Length) - 1 Dim tempChild As Form = CType(Me.MdiChildren(j), Form) tempChild.Visible = True Next Have you tried setting a condition breakpoint that fires when the
enabled or readonly property changes? That may lead to the source of the problem. Thanks, Seth Rowe Kevin wrote: Show quoteHide quote > I've modified a combobox class so that it has a ReadOnly property. > When set to ReadOnly, the combobox can't be changed, but it doesn't > appear gray. I called the new class ComboLockBox and I've placed them > on a MDIChild form and they work great. > > The problem is, I got a timer that looks for mouse activity and when > the mouse is idle for a set number of minutes, all MDIChild forms are > hidden and the Logon form is displayed. > > When the user logs back on, the visible property of the forms is set > back to True. The ComboLockBox controls are no longer the modified > class I created, but are regular comboboxes and are grayed out. > Setting my ReadOnly property or the Enabled property of the boxes > doesn't change anything. > > What's happening to my class? > > Here's the code I use to hide the forms: > > Try > For j = 0 To (Me.MdiChildren.Length) - 1 > Dim tempChild As Form = CType(Me.MdiChildren(j), Form) > tempChild.Visible = False > Next > For i As Integer = 0 To My.Application.OpenForms.Count - 1 > If My.Application.OpenForms(i).Name <> "frmMain" Then > My.Application.OpenForms(i).Visible = False > End If > Next > Catch > MsgBox(Err.Description, MsgBoxStyle.Critical, "AN ERROR > OCCURRED WHILE HIDING THE FORMS") > 'do nothing > End Try > > > and this unhides the forms: > > Dim m As System.Windows.Forms.Form > > For Each m In My.Application.OpenForms > If m.Name <> "frmMain" Then > m.Visible = True > End If > Next m > > For j = 0 To (Me.MdiChildren.Length) - 1 > Dim tempChild As Form = CType(Me.MdiChildren(j), Form) > tempChild.Visible = True > Next
MDI Min Max - still there
Q: closing forms CURRENT INDEX of Iteration on ILIST collection ? da.update bool--> yes/no 1.1 equivalent for Drawing.Icon.ExtractAssociatedIcon? Writing Custom DLLs in VB.net 2 Accessing the Class Name of a Shared Method Re: Reading a list of users from XP VS 2005: Forms Designer Clears CancelButton and AcceptButton on Compile Recursive Directory / File Listing With Progress? |
|||||||||||||||||||||||