Hscrollbar Dan Vscrollbar Pada Visual Basic

Posted by admin
Hscrollbar Dan Vscrollbar Pada Visual Basic 4,6/5 4186 reviews

My Windows Application in VB 6 is having a form that contains hell lot of controls. And if the screen size at client's environment is smaller, most of the controls do not appear.What I want to do is to provide users a vertical and horizontal scrollbar so that user can scroll across all controls.Anyone having any idea of how to implement this?

Home Visual Basic Menggunakan Hscrollbar Dan Vscrollbar. Menggunakan Hscrollbar Dan Vscrollbar Penulis Unknown. Diterbitkan 10.48. Visual Basic. Kontrol ScrollBar( baik Hscrollbar maupun Vscrollbar ) merupakan kontrol yang dapat digunakan untuk melakukan penambahan atau pengurangan nilai dengan posisi hriontal dan vertikal.

P.S. Please do not provide examples showing just labels to display scroll value :)

  1. Home Visual Basic Menggunakan Hscrollbar Dan Vscrollbar. Menggunakan Hscrollbar Dan Vscrollbar Penulis Unknown. Diterbitkan 10.48. Visual Basic. Kontrol ScrollBar( baik Hscrollbar maupun Vscrollbar ) merupakan kontrol yang dapat digunakan untuk melakukan penambahan atau pengurangan nilai dengan posisi hriontal dan vertikal.
  2. HscrollBar dan VscrollBar Control, kedua control ini digunakan untuk ScrollBar. Timer Control, merupakan control yang tidak terlihat pada saat program dijalankan. Control tersebut membangkitkan kejadian pada selang waktu tertentu.
NirmanNirman
3,54513 gold badges59 silver badges105 bronze badges

2 Answers

I like David's answer, but if you want to do this with the scrollbars, first, you need to put all of your controls into a frame that fits them. You want to move 1 control not a 'hell of a lot of controls'. Second put your scroll bars into the form and in the Form_Resize event add some code to resize the scroll bars with the form. After resizing the scrollbar you need to do some math to set the Max, SmallChange, and LargeChange properties. I am showing the Min property just so you know it never changes, just set it in the designer. This example uses only a horizontal scrollbar because I am too lazy to include a vertical scrollbar too. Finally, add code to the scrollbar Change event to move the frame around.

You also need error handling code. I am a lazy example coder.

jacjac
8,3602 gold badges23 silver badges59 bronze badges

One way is to turn on the scroll bars of your form using Windows API calls. This is different from using ScrollBar controls; turning on the form's own scroll bars keeps the scroll bars from interfering with the tab order, for example.

Here is a good page explaining how to do this, along with a helper class:

prprcupofcoffeeprprcupofcoffee

Not the answer you're looking for? Browse other questions tagged vb6scrollbarwindows-applications or ask your own question.

i need to add vscroll control to a form in VB.net and i need to use it to scroll the form where i need to add more controls in the form where the size of form not able me to add them ?

and i need to know how to make the scrolling to show more controls in the form ?

thank you in advance

Cody Gray
198k37 gold badges398 silver badges482 bronze badges
Islam MuntasserIslam Muntasser

2 Answers

dardadarda
1,2403 gold badges20 silver badges38 bronze badges

'Vscroll' is not the name of a control, but I assume it's an abbreviation for vertical scrollbar.

Visual

In that case, you can simply add a VScrollBar control to your form. You'll find it in the Toolbox under the 'All Windows Forms' category. Unfortunately, you'll have to wire it up yourself. By default, the control won't do anything exciting.

Hscrollbar Dan Vscrollbar Pada Visual Basic C

Pada

HScroll and VScroll are also properties of any control that derives from ScrollableControl, such as a form and all panel controls. By setting one or both of these properties to 'True', you can cause a horizontal or vertical scroll bar to appear, no additional control required.

But before you embark too far down this road, I should caution you against reinventing the wheel. Controls that derive from ScrollableControlalso have an AutoScrollDevin townsend tour 2019. property that will cause scrollbars to appear automatically when the content they contain does not fit in the viewable area of the control. Simply set this property to 'True', and let the magic happen. It maintains the visibility of the scrollbars automatically, eliminating the need to use a separate control or set the HScroll or VScroll properties.

If I were you, I would add either a TableLayoutPanel or a FlowLayoutPanel control to my form, and then place all of the other controls I wanted to add inside of the panel. Then, I would just turn on the AutoScroll property and let the control maintain everything automatically.

Cody Gray

Hscrollbar Dan Vscrollbar Pada Visual Basic Ms Excel

Cody Gray
198k37 gold badges398 silver badges482 bronze badges

Not the answer you're looking for? Browse other questions tagged .netvb.netwinformsscrollbarscrollable or ask your own question.