Sign in to follow this  

[.net] Handling HScrollBar

This topic is 3571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I want to HORIZONTALLY scroll 2 listView at the same time. I add a HScrollBar and put it over the ORIGINAL listView scrollBar. But by adding HScrollBar, the last listView item cannot be seen well. How to make the last listView item seen well? I have tried like this to get the 2nd listView and the 2nd ScrollBar move but nothing's happened: private: static int const WM_HSCROLL = 0x0115; private: System::Void Form1_Load(Object^ sender, System::EventArgs^ e) { // HScrollBar this->hsb1->Left = this->listView1->Left; this->hsb1->Top = this->listView1->Bottom - 21; this->hsb1->Width = this->listView1->Width; this->hsb1->Height = 20; this->hsb1->SmallChange = 5; this->hsb1->Minimum = 0; this->hsb1->Maximum = listView1->Columns[0]->Width + listView1->Columns[1]->Width + listView1->Columns[2]->Width;//listView1->Columns->Count - 1; this->hsb2->Left = this->listView2->Left; this->hsb2->Top = this->listView2->Bottom - 21; this->hsb2->Width = this->listView2->Width - 1; this->hsb2->Height = 20; this->hsb2->Minimum = 0; this->hsb2->Maximum = listView1->Columns[0]->Width + listView1->Columns[1]->Width + listView1->Columns[2]->Width;//listView2->Columns->Count - 1; this->hsb2->SmallChange = 5; this->hsb1->ValueChanged += gcnew EventHandler(this, &Form1::hsb_ValueChanged); this->hsb2->ValueChanged += gcnew EventHandler(this, &Form1::hsb_ValueChanged); this->Controls->Add(this->hsb1); this->Controls->Add(this->hsb2); this->hsb1->BringToFront(); this->hsb2->BringToFront(); // HScrollBar } //end of Form1_Load private: void hsb_ValueChanged(Object ^sender, System::EventArgs ^e) { SendMessage(listView1->Handle, WM_HSCROLL, 0, 0); SendMessage(listView2->Handle, WM_HSCROLL, 0, 0); } But nothing's happen when I slide the HScrollBar. What was wrong? Thank you very much.

Share this post


Link to post
Share on other sites
Honestly this about the 10th time you've posted this same question!

I've already told you that I really doubt that your lecturer would create an assignment that required you to use p/invoke. I really doubt that. I think you are reading the "scroll two listview's together" too literally.

I already posted managed code that scrolls two ListView's so they match the selected item. I can't imagine they would ask you to go beyond that.

Now if you can't figure it out by searching on Google then read a book or something. Follow your course outline. If all else fails just give up! Lose a few marks, who cares. You arn't learning anything by getting all the answers here anyway.

Share this post


Link to post
Share on other sites

This topic is 3571 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Guest
This topic is now closed to further replies.
Sign in to follow this