Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.


734 posts

Ultimate Geek
+1 received by user: 27

Trusted

Topic # 59937 15-Apr-2010 11:32
Send private message

Hey all,

I have made a basic application using Visual Studio 2005 in VB.Net

I need to know how to make the form move with scrollbars.

I currently have a Vbar and Hbar docking in the right place when i load the form, however as i haven't coded yet, sliding the bar does nothing.

Can someone more experienced give me a hand here?

Code is here, its saved in Rich Text Format, its not sensative so posting is no risk

http://www.treatmentx.org/Hosted_Data/Crucias.AP.Calc.rtf 

Thanks all!

Chris

Crucias AP App vB1 




Homebuilt High Performance Desktop: Windows 10 Professional (x64)
Toshiba Encore Write 2: Windows 10
Nokia 930: Windows Phone 10
Samsung Tab4 7": Android Lolipop
XBL: CruciasNZ
PSN: CruciasNZ
Steam: Lienhart2005


Create new topic


734 posts

Ultimate Geek
+1 received by user: 27

Trusted

  Reply # 318720 15-Apr-2010 11:50
Send private message

PS - Also happy to program the form just to be resizable and therefore scale its contents (thats probably more useful)




Homebuilt High Performance Desktop: Windows 10 Professional (x64)
Toshiba Encore Write 2: Windows 10
Nokia 930: Windows Phone 10
Samsung Tab4 7": Android Lolipop
XBL: CruciasNZ
PSN: CruciasNZ
Steam: Lienhart2005


27 posts

Geek


  Reply # 318730 15-Apr-2010 12:03
Send private message

I think all you need to do is set the AutoScroll property of the form control to true, then resize the form to the desired viewing area and scroll bars are created automatically.

dpw

812 posts

Ultimate Geek
+1 received by user: 13

Trusted

  Reply # 318733 15-Apr-2010 12:19
Send private message

Ok...let me get this write...have you just written yourself a spreadsheet?

Anyway, regardless of that, what exactly are you trying to achieve? What governs the scrolling, where are you scrolling to?

It seems you have just added scrollbar controls to the form - is that right? You may just want to make your form automatically show scrollbars when the content overflows the form. It's been a while since I've done .NET 2.0 in VS2005 - the property name escapes me at the moment.

Hope that makes sense?




Android user, software developer, a semi-typical (not a gamer) geek, and a Bernese Mountain Dog nut!

http://savitarbernese.com | https://nz.linkedin.com/in/danywu



734 posts

Ultimate Geek
+1 received by user: 27

Trusted

  Reply # 318740 15-Apr-2010 12:27
Send private message

Its not a spreadsheet, its a calculator for a game.

i can resize the form, but it wont shrink the controls inside it. Nor will it scale them up.

I want to resize the whole form, so the boxes etc inside scale with it. I don't know how to do this :( 




Homebuilt High Performance Desktop: Windows 10 Professional (x64)
Toshiba Encore Write 2: Windows 10
Nokia 930: Windows Phone 10
Samsung Tab4 7": Android Lolipop
XBL: CruciasNZ
PSN: CruciasNZ
Steam: Lienhart2005


dpw

812 posts

Ultimate Geek
+1 received by user: 13

Trusted

  Reply # 318741 15-Apr-2010 12:31
Send private message

Sorry...forgot to put a smiley...was just kidding about the spreadsheet thing :o)

Anyway, you have to "pin" various corners of the controls to the container to make it resize with the container. It's all in the Property panel for each control.




Android user, software developer, a semi-typical (not a gamer) geek, and a Bernese Mountain Dog nut!

http://savitarbernese.com | https://nz.linkedin.com/in/danywu

dpw

812 posts

Ultimate Geek
+1 received by user: 13

Trusted

  Reply # 318742 15-Apr-2010 12:33
Send private message

Sorry...not "Pin"...I think the word is "Anchor"

Use a combination of anchoring and docking to place and automatically size the controls. If you want various controls to respond differently to the form resizing then you can always group them in various containers, eg. Panel, GroupBox, etc.




Android user, software developer, a semi-typical (not a gamer) geek, and a Bernese Mountain Dog nut!

http://savitarbernese.com | https://nz.linkedin.com/in/danywu



734 posts

Ultimate Geek
+1 received by user: 27

Trusted

  Reply # 318778 15-Apr-2010 13:15
Send private message

i managed to get the scrolling working, unfortunately the process for scaling seems to out of it for me




Homebuilt High Performance Desktop: Windows 10 Professional (x64)
Toshiba Encore Write 2: Windows 10
Nokia 930: Windows Phone 10
Samsung Tab4 7": Android Lolipop
XBL: CruciasNZ
PSN: CruciasNZ
Steam: Lienhart2005


dpw

812 posts

Ultimate Geek
+1 received by user: 13

Trusted

  Reply # 318793 15-Apr-2010 13:51
Send private message

It's not too convoluted a concept - if you google "winform anchor and dock" there are plenty of examples and tutorials out there.




Android user, software developer, a semi-typical (not a gamer) geek, and a Bernese Mountain Dog nut!

http://savitarbernese.com | https://nz.linkedin.com/in/danywu

6 posts

Wannabe Geek


  Reply # 320193 19-Apr-2010 12:17
Send private message

I'm not efficient in VB however I am in C# and the process is the same. In visual Studios, in the properties sidebar there will be a propertie called "anchor" click on the ellipses (or arrow) next to it. It will show you some boxes. These boxes represent the sides of the form.
you want to anchor the controls to the top and left boxes to hold them in that place. If you anchor them to the right and bottom boxes they will expand and contract as the form does.
There are other ways of doing this, you could write a method that gets the forms size and adjusts the controls accordingly as the form is resized. However the anchor method is probably the best bet without any direct coding.

Hope this helps.

Create new topic

Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

N4L helping TAKA Trust bridge the digital divide for Lower Hutt students
Posted 18-Jun-2018 13:08


Winners Announced for 2018 CIO Awards
Posted 18-Jun-2018 13:03


Logitech Rally sets new standard for USB-connected video conference cameras
Posted 18-Jun-2018 09:27


Russell Stanners steps down as Vodafone NZ CEO
Posted 12-Jun-2018 09:13


Intergen recognised as 2018 Microsoft Country Partner of the Year for New Zealand
Posted 12-Jun-2018 08:00


Finalists Announced For Microsoft NZ Partner Awards
Posted 6-Jun-2018 15:12


Vocus Group and Vodafone announce joint venture to accelerate fibre innovation
Posted 5-Jun-2018 10:52


Kogan.com to launch Kogan Mobile in New Zealand
Posted 4-Jun-2018 14:34


Enable doubles fibre broadband speeds for its most popular wholesale service in Christchurch
Posted 2-Jun-2018 20:07


All or Nothing: New Zealand All Blacks arrives on Amazon Prime Video
Posted 2-Jun-2018 16:21


Innovation Grant, High Tech Awards and new USA office for Kiwi tech company SwipedOn
Posted 1-Jun-2018 20:54


Commerce Commission warns Apple for misleading consumers about their rights
Posted 30-May-2018 13:15


IBM leads Call for Code to use cloud, data, AI, blockchain for natural disaster relief
Posted 25-May-2018 14:12


New FUJIFILM X-T100 aims to do better job than smartphones
Posted 24-May-2018 20:17


Stuff takes 100% ownership of Stuff Fibre
Posted 24-May-2018 19:41



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.