473,385 Members | 1,848 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

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.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
Oct 2 '06 #1
1 1762
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.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
Oct 2 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Billy Jacobs | last post by:
I have created a DataGridColumnDatePicker Component so that I can put a datetimepicker control in my datagrid. It almost works. When I put my mouse in the cell it changes to a datetimepicker...
0
by: Jax | last post by:
I am using a class that inherits from the DataGridTextBoxColumn. It adds a combo box into the column where it displays a selection of choices. The problem I have is that when this comboBox loses...
15
by: Ken Allen | last post by:
I have been developing a suite of assemblies over the past couple of weeks, and this afternoon somethign started misbehaving. If I do not run the IDE and compiler the code from the command line,...
3
by: TT (Tom Tempelaere) | last post by:
Hay there, I'm writing my own DataGridComboBoxColumn because .NET 1.1 does not have one (I hope .NET 2.0 supplies one). I based it on this article:...
3
by: Geraldine Hobley | last post by:
Hello, In my project I am inheriting several forms. However when I inherit from a form and add additional subroutines and methods to my inherited form I get all sorts of problems. e.g. I sometimes...
30
by: dbuchanan | last post by:
ComboBox databindng Problem == How the ComboBox is setup and used: My comboBox is populated by a lookup table. The ValueMember is the lookup table's Id and the DisplayMember is the text from a...
0
by: mjsterz | last post by:
I've been working with VB .NET for less than a year and this is the first time I've posted on one of these groups, so let me apologize beforehand if I'm being unclear, not posting my issue...
1
by: Dale | last post by:
I have a user control on a Windows Form that, in its Load event handler, calls a method from a class library to initialize an array of objects that are then used to populate a ComboBox. When I...
3
by: Gerrit | last post by:
Hi, I try to learn programming in c# with databinding controls. Now I have a problem with a ComboBox with the advanced properties for databinding, I want to set the DataSourceUpdateMode to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.