Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

groupbox control/event 'enter' or 'mouseover' or similar

Status
Not open for further replies.

lunaclover

Programmer
Jun 22, 2005
54
Hi earthandfire (and others), sorry for the delay in getting back to you.. I have finally tried the code you helped me with, (well, most of it) and I think I can do beautiful things with it. The case statement wouldn't really pertain to what I am trying to do, so I didn't use it.

But - what I need to do, is if an item in the listbox has been selected, this code (listbox.selectedindex = -1) needs to be called IF:

* the user chooses another item where there is already a choice (radiobutton) selected in a combobox of about 8 radiobuttons.

I was looking for something like groupbox2.enter or groupbox2.mouseenter or something that basically says if this groupbox is entered (or really if any radiobutton within it is selected when (1) one is already selected or (2) a listbox selection is made) then unselect the listbox selection using the aforementioned code.

However, these events (enter and mouseenter) don't exist with a groupbox. Is there a way I can accomplish this with a groupbox? Or how can I make it inherit these events so I can use them? Can I do this at all?

Thanks again for your help in advance.
Luna
 
Hi all,
Nevermind, I figured it out.. all I needed to do was put the groupbox2.enter in the handles statement.. how weird that I wouldn't try that, it seems so simple now. Afterall, I love the handle and abuse it all the time.

I was messing around with if-then-else and case statements for no reason. Here's all I did.

Code:
    Private Sub error_catching(ByVal sender As Object, ByVal e As System.EventArgs) Handles GroupBox1.Enter, GroupBox2.Enter  

        'deselects listbox to prevent error
        lbHeatTypeSize.SelectedIndex = -1

    End Sub

Thanks anyway! I'm sure I'll be back later! ; )

Luna
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top