Problem with modified Combobox class

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Kevin

    #1

    Problem with modified Combobox class

    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.MdiChi ldren(j), Form)
    tempChild.Visib le = False
    Next
    For i As Integer = 0 To My.Application. OpenForms.Count - 1
    If My.Application. OpenForms(i).Na me <"frmMain" Then
    My.Application. OpenForms(i).Vi sible = False
    End If
    Next
    Catch
    MsgBox(Err.Desc ription, MsgBoxStyle.Cri tical, "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.MdiChi ldren(j), Form)
    tempChild.Visib le = True
    Next
  • rowe_newsgroups

    #2
    Re: Problem with modified Combobox class

    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:
    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.MdiChi ldren(j), Form)
    tempChild.Visib le = False
    Next
    For i As Integer = 0 To My.Application. OpenForms.Count - 1
    If My.Application. OpenForms(i).Na me <"frmMain" Then
    My.Application. OpenForms(i).Vi sible = False
    End If
    Next
    Catch
    MsgBox(Err.Desc ription, MsgBoxStyle.Cri tical, "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.MdiChi ldren(j), Form)
    tempChild.Visib le = True
    Next

    Comment

    Working...