Mouse cursor

G

Guest

Hi,
I have a windows form with a ownerdraw combobox. When I draw the combobox
items I also change the mouse cursor to something different than
Cursors.Default.
When the DropDown opens and the cursor moves inside, the cursor changes
correctly. However, I would like to change the cursor back to Cursors.Default
if the mouse exits the DropDown boundaries.
I tried to force the cursor in Form.MouseMove but it doesn't work.
Does anyone know how this can be done?
Thank you!
Vitor
 
O

OD

Hi,
I have a windows form with a ownerdraw combobox. When I draw the combobox
items I also change the mouse cursor to something different than
Cursors.Default.
When the DropDown opens and the cursor moves inside, the cursor changes
correctly. However, I would like to change the cursor back to Cursors.Default
if the mouse exits the DropDown boundaries.
I tried to force the cursor in Form.MouseMove but it doesn't work.
Does anyone know how this can be done?
Thank you!
Vitor

You must not change the cursor in the ownerdraw event handler. Cursor
for your combobox must changed when the dropdown is opened and closed.
Look at DropDown and DropDownClosed events of the combobox, and change
the cursor in the first one, and set it back to the default cursor in
the second one.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top