Home > Net >  To realize the mouse movement in the drop-down list box, images show preview, chose an option, such
To realize the mouse movement in the drop-down list box, images show preview, chose an option, such

Time:12-29

My Windows forms in vb.net applications, there is a drop-down list box, combobox, have more than one option in the drop-down list box, now in order to realize the mouse in the options, the right has a picturebox control that will display the corresponding images, one in the election, it shows the selected images,
In combobox option when the mouse moves, the preview effect on the right side, namely the move into that option is to show that, when clicking on the selected, will display the selected pictures,
What kind of events in the combobox?

CodePudding user response:

Recognize a way that can give a?

CodePudding user response:

I can think of is, click on the drop-down box after open a thread regularly, real-time access to current mouse coordinates, if in a box which box is displayed in the picture, but I don't know what form to achieve preview page, unless you customize a, small white an idea so point

CodePudding user response:

You should use SelectedIndexChanged
Example:
Private Sub ComboBox1_SelectedIndexChanged (sender As Object, As EventArgs e) Handles ComboBox1. SelectedIndexChanged
Dim nCombo As ComboBox=sender
PictureBox1. Image=New Bitmap (nCombo. SelectedItem. ToString) 'hypothesis nCombo SelectedItem="aa. BMP
"End Sub

CodePudding user response:

The mouse movement in the drop-down list, choose rather than directly, if the mouse in the drop-down list to select a click, this I will now need to move the mouse in the drop-down list items, from a move to another can trigger,

CodePudding user response:

reference u010499002 reply: 3/f
should use SelectedIndexChanged
Example:
Private Sub ComboBox1_SelectedIndexChanged (sender As Object, As EventArgs e) Handles ComboBox1. SelectedIndexChanged
Dim nCombo As ComboBox=sender
PictureBox1. Image=New Bitmap (nCombo. SelectedItem. ToString) 'hypothesis nCombo SelectedItem="aa. BMP
"End Sub


The mouse movement in the drop-down list, choose rather than directly, if the mouse in the drop-down list to select a click, this I will now need to move the mouse in the drop-down list items, from a move to another can trigger,
  • Related