Home > Microsoft .Net Development Tips > ARCHIVE: Tips & Tricks > Scroll through data entries
Win Development Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ARCHIVE: TIPS & TRICKS

Scroll through data entries


Ron McCarthy
05.08.2001
Rating: -3.71- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


Scroll through data entries
Ron McCarthy

Reader Ron McCarthy gives us a nifty tip on how to see data entries when there are more of them than will fit on your tiny screen.


Have you ever needed to scroll through a large number of data entry elements only to find that the screen isn't big enough to show them all, especially in 800 X 600 resolution. Well here's the answer: "Scrolling Frames."

To see how it works:

  1. Create a form that does not display fully when maximized.
  2. Add a standard frame. Make the frames height bigger than the forms height.
  3. In the frame place as many textboxes as needed to fill the frame from top to bottom. Note: Make them a control array so as not to exceed the 255 controls per form limit.
  4. Add a FlatScrollBar to the form just to the right of the frame.
  5. Set the following properties:
      Appearance = 0 - fsb3D
      Orientation = 0 - cc2OrientationVertical
      LargeChange = 500
      SmallChange = 100

When you run the application and the form is bigger than what can be displayed on the screen, the scroll bar will allow you to scroll the frame up and down so the text boxes will become visible. Of course you could put any of the other VB controls in the frame as needed for your application. The Form_Resize takes care of making the scroll bar fit on the visible form and that the frame will scroll up and down properly.

Code:

Option Explicit

Private Sub Form_Load()
    Form_Resize
End Sub

Private Sub Form_Resize()
    'So the bar doesn't fall off the bottom
    FlatScrollBar1.Height = Me.Height - 400
    'Sets the scrollBar.max to a negitive number
    FlatScrollBar1.Max = Me.Height - (fraMain.Height + 450)
End Sub

Private Sub FlatScrollBar1_Change()
    Frame1.Top = FlatScrollBar1.Value
End Sub

Private Sub FlatScrollBar1_Scroll()
    Frame1.Top = FlatScrollBar1.Value
End Sub

Related Book

Beginning Visual Basic 6 Application Development
Author : Pierre Boutquin, Jason Bock, Diane Poremsky, Matthew Reynolds Kent Sharkey, Ken Slovak, Lee Whitney
Publisher : Wrox Press
Published : Jul 2000
Summary:
Visual Basic is a versatile language ? accessible to those seeking to enter the world of programming, yet powerful enough to support the coding of complex, distributed applications. By showing you step-by-step how to design, implement, and deploy a fully functional sophisticated application based on an online banking scenario, this book will cover the conceptual and practical implications of application development. We'll cover the full range of topics that impinge on such a project; from software architecture and project planning, through analysis of business requirements and software design by UML, to the practical coding of COM components operating in a transactional environment and the creation of a database to support these activities.


Rate this Tip
To rate tips, you must be a member of SearchWinDevelopment.com.
Register now to start rating these tips. Log in if you are already a member.


Submit a Tip




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
ARCHIVE: Tips & Tricks
SearchVB wants your tips
Find out what VS.NET modules are installed
Retrieving icons from an EXE-file
Toggling Boolean values
VS.NET multiple tabbed windows
Set the value of a DataField in code behind
Easy grid design
Open using last Visual Studio.NET layout
Save development time by using inherited forms
Reusing code in VS.NET

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



Database Programming Solutions - .NET XML, Visual Studio LINQ, ORM .NET
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2000 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts