i have 4 listboxes that are filled with product information. forexample one has the brand and the other the id. when i click on one item in the id the same index of the brand is also clicked. i have a problem regarding the scroll bars. i need to know how to combine the scroll bars with each other forexample when i scroll down the id list then the brand listbox also scrolls down the same number of items. does anyone know how to do this? and if it isnt possible is there any alternative? like having multiple columns in one listbox? but i really need to leave it like this so if u can find a solution then many thanks.
Nevillelajru
0
Newbie Poster
Recommended Answers
Jump to PostYou can't do it with the normal listbox as it doesn't have a scroll event. So you need to create your own listbox:
using System.Windows.Forms; namespace WindowsFormsApplication1 { public class MyListBox : ListBox { public delegate void ScrollEventHandler(Message m); public event ScrollEventHandler Scroll; protected override void WndProc(ref …
Jump to Postprivate void lbID_Scroll(Message m) { SendMessage(lbID.Handle, m.Msg, m.WParam, m.LParam); }
This code says "If I scroll send a message to me that I scrolled". This will continue until you get a stack overflow. You send a message to a different control to tell it to scroll, not …
All 7 Replies
Momerath
1,327
Nearly a Senior Poster
Featured Poster
ddanbe
commented:
Shows deep knowledge!
+9
Nevillelajru
0
Newbie Poster
Nevillelajru
0
Newbie Poster
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Nevillelajru
0
Newbie Poster
Momerath
1,327
Nearly a Senior Poster
Featured Poster
Nevillelajru
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.