Visual Basic

Moderators: None (Apply to moderate this forum)
Number of threads: 18013
Number of posts: 55386

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
need help with scrollbar Posted by FMP on 14 Oct 2005 at 9:07 PM
hello, i am a student just learning VB and the book that my class is using does not have any thing about scrollbars, and i cant get it to work, can someone please explane how to make it work right (either through explanation or throught example). thank you.
Report
Re: need help with scrollbar Posted by pseudocoder on 16 Oct 2005 at 2:38 PM
: hello, i am a student just learning VB and the book that my class is using does not have any thing about scrollbars, and i cant get it to work, can someone please explane how to make it work right (either through explanation or throught example). thank you.
:

I'm hardly a VB guru, but I'll try to offer something - for VB anyway... dunno about .Net. If you're using the built in controls, then

VScroll and HScroll both have a max and min property that can be set at run time. For example, if you create a project that has a list box, and a vertical scroll bar for a class of 5 students, and each value of the scroll bar represents a single student that is in the listbox then

Form_Load

   Dim i As Integer
   
   For i = 0 To 4
      List1.AddItem "Student " & CStr(i + 1)
   Next
      
   vscroll1.Min = 0
   vscroll1.Max = 4
   vscroll1.Value = 0

   List1.Selected(vscroll1.Value) = True
------------------

VScroll1_Change

List1.Selected(VScroll1.Value) = True ' choose the desired student
------------------


If you ran that, you *should* see the highlighted item in the list box change in relation to the current value of the scroll bar.
Report
Re: need help with scrollbar Posted by FMP on 17 Oct 2005 at 6:44 PM
thanks, i will try that.
Report
Re: need help with scrollbar Posted by FMP on 25 Oct 2005 at 6:30 PM
i tried that bit of code and got it to work but when i tried to apply it to what i am doing i could not get it to work.

in short, i am trying to get a scroll bar to work with a large amount of text, i am not sure if i should use a label or an OLE. also something i forgot to mention, i am useing a student version which has some of the features disabled.

thanks
Report
Re: need help with scrollbar Posted by Bulgarian_VB on 26 Oct 2005 at 1:55 PM
: i tried that bit of code and got it to work but when i tried to apply it to what i am doing i could not get it to work.
:
: in short, i am trying to get a scroll bar to work with a large amount of text, i am not sure if i should use a label or an OLE. also something i forgot to mention, i am useing a student version which has some of the features disabled.
:
: thanks
:
Just put all the text in a textbox, and enable scrollbars from the TextBox properties. If you don't want the text to be editted, just set the Locked property to True.

Using Label with external scrollbar to scroll the text is somewhat complicated, so don't look into that right now.

Hope I helped,
Nikolay Semov

Report
Re: need help with scrollbar Posted by FMP on 27 Oct 2005 at 6:44 PM
thank you, i will try that.

FMP
Report
Re: need help with scrollbar Posted by FMP on 28 Oct 2005 at 6:03 AM
everything i have done has not worked, might you have any other sugestions? thank you.

FMP



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.