By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,070 Members | 1,237 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,070 IT Pros & Developers. It's quick & easy.

Scroll buttons in my owner draw ListBox don't work

P: n/a
I have a ListBox hold a list of my custom controls (it's UserControl based
control with a couple radio buttons and a checkbox). Everything works and
displays the way I expected it to. I can move through the list by dragging
the scroll bar and it works fine, but if I try to use the up/down scroll bar
buttons or page by clicking above or below the scroll thumb button the list
does not scroll.

Here's my OnDrawItem for the ListBox:

private void OnDrawItem(object sender,
System.Windows.Forms.DrawItemEventArgs e)
{
//m_PidList is a System.Windows.Forms.ListBox
e.DrawBackground();
((GaugeStyleSelect)m_PidList.Items[e.Index]).Bounds = e.Bounds;
//e.DrawFocusRectangle();
}

I don't normally do front end side code and was very pleased at how easy C#
made it, or so I thought.

Any ideas on what I'm missing?

Thanks,
jim
Nov 16 '05 #1
Share this Question
Share on Google+
12 Replies


P: n/a
Hi Jim,

Thank you for posting here. Regarding on the issue, I am
finding proper resource to assist you and we will update as soon as posible.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security(This posting is provided "AS IS",
with no warranties, and confers no rights.)

Nov 16 '05 #2

P: n/a
Hi Jim,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you click on the up/down button of
the owner draw ListBox's scroll bar, the content didn't get scrolled. If
there is any misunderstanding, please feel free to let me know.

To troubleshoot on this issue, I think it's better to see more code on this
form. Could you please create a small repro package and send it to me by
email? Remove 'online' from the no spam alias is my real email address.
Thanks for your cooperation.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #3

P: n/a
Hi Jim,

Thanks for the repro package, I have review the code and still researching
on it. Please also check the following link which provides us with a sample
for owner draw listboxes.

http://www.codeproject.com/cs/combobox/glistbox.asp

HTH. I will continue researching on this and will update you as soon as I
get any information.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #4

P: n/a
I created my own List like in the sample link you sent me instead of
handling the OnDrawItem event in the form. I got the exact same results.
It still won't scroll using the up/down buttons.

Jim

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:3i**************@cpmsftngxa10.phx.gbl...
Hi Jim,

Thanks for the repro package, I have review the code and still researching
on it. Please also check the following link which provides us with a
sample
for owner draw listboxes.

http://www.codeproject.com/cs/combobox/glistbox.asp

HTH. I will continue researching on this and will update you as soon as I
get any information.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #5

P: n/a
I also posted this as a separate post in this group incase someone else may
know the answer.

The DrawItem triggered when I drag the scroll button but NOT when I click
the up/down
arrows on the scroll bar of the ListBox. How do I handle the user clicking
the up/down arrows?

Thanks for your help,
Jim

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:3i**************@cpmsftngxa10.phx.gbl...
Hi Jim,

Thanks for the repro package, I have review the code and still researching
on it. Please also check the following link which provides us with a
sample
for owner draw listboxes.

http://www.codeproject.com/cs/combobox/glistbox.asp

HTH. I will continue researching on this and will update you as soon as I
get any information.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #6

P: n/a
Hi Jim,

If you hold the mouse button down, the scroll also works fine. With Spy++,
it seems that the first VSCROLL message has been lost. I will try find some
expert on this to take a look. I will update you soon.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #7

P: n/a
Yeah, if you hold the scroll button down the list scrolls fine as well. If
you just click it, the last item in the list pops up to the front then it
doesn't respond to clicks at all. The DrawItem event does not get kicked
off for those clicks either.

Thank you.

"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:Yx**************@cpmsftngxa06.phx.gbl...
Hi Jim,

If you hold the mouse button down, the scroll also works fine. With Spy++,
it seems that the first VSCROLL message has been lost. I will try find
some
expert on this to take a look. I will update you soon.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #8

P: n/a
Hi Jim,

I have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #9

P: n/a
Thanks for the update. I appreciate your help.

Jim
"Kevin Yu [MSFT]" <v-****@online.microsoft.com> wrote in message
news:ZE**************@cpmsftngxa06.phx.gbl...
Hi Jim,

I have reviewed this issue and are currently researching on it. We will
update you ASAP. Thanks for your patience!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #10

P: n/a
Hi Jim,

I did more research on this issue. I can reproduce this on my computer.
However, some other computers in our team cannot reproduce this. It seems
to be machine specific.

Looking at the nature of this issue, it would require intensive
troubleshooting which would be done quickly and effectively with direct
assistance from a Microsoft Support Professional through Microsoft Product
Support Services. You can contact Microsoft Product Support directly to
discuss additional support options you may have available, by contacting us
at 1-(800)936-5800 or by choosing one of the options listed at
http://support.microsoft.com/default...d=sz;en-us;top. If this is not
an urgent issue and your would like us to create an incident for you and
have Microsoft Customer Service Representative contact you directly, please
send email to (remove "online." from this no Spam email address):
mailto:ds******@online.microsoft.com with the following information,

* Include "Followup: <Tomcat IssueID>" in the email Subject.
*Location of the post
*Subject Line
* First Name, Last Name
*MSDN Subscriber ID
*Company name (if any)
*Phone number
*e-mail address

Thanks!

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #11

P: n/a
Sorry, Jim.

Please try this again with the following address.

http://support.microsoft.com/default.aspx

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #12

P: n/a
You're welcome, Jim.

Thanks for sharing your experience with all the people here. If you have
any questions, please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Nov 16 '05 #13

This discussion thread is closed

Replies have been disabled for this discussion.