Welcome Guest!
 VB 6 Helper
 Previous Message All Messages Next Message 
VB 6 Helper Newsletter  Rod Stephens
 May 30, 2009 06:43 PDT 

Just a short one this week.

Have a great week and thanks for subscribing!

Rod
RodSte-@vb-helper.com

Books To Keep: http://www.BooksToKeep.com
----------
*** Now Available ***

Beginning Database Design Solutions
http://www.amazon.com/exec/obidos/ASIN/0470385499/vbhelper/

Visual Basic 2008 Programmer's Reference
http://www.amazon.com/exec/obidos/ASIN/0470182628/vbhelper/
==========

    VB6 Contents:
1. New HowTo: Let the user move and resize controls at run time in
Visual Basic 6

    Both Contents:
2. New Links
==========
++++++++++
   <VB6>
++++++++++
==========
1. New HowTo: Let the user move and resize controls at run time in
Visual Basic 6
http://www.vb-helper.com/howto_move_resize_at_runtime.html
http://www.vb-helper.com/HowTo/howto_move_resize_at_runtime.zip

This example is from my book:

    Custom Control Library
    http://www.vb-helper.com/ccl.htm

This book includes 101 custom ActiveX controls written for Visual Basic
5 and 6.

This example builds an ActiveX control that allows the user to move and
resize the control at run time. It automatically resizes the control it
contains to fit.

Note that I don't necessarily recommend this strategy. Users will
eventually do something silly like give a control zero size or move it
off the form so be sure you have a way to reset the controls if
necessary.

The UserControl contains a small PictureBox named Corner in its lower
right corner. That control tracks its MouseDown, MouseMove, and MouseUp
events. As you drag that control, the following code resizes the
UserControl, puts Corner back in the lower right corner, and resizes
contained controls to fit.

Private Sub UserControl_Resize()
Dim hgt As Single
Dim ctl As Control

    ' Do nothing at design time.
    If Not Ambient.UserMode Then Exit Sub
    
    ' Position the corner dragger.
    hgt = ScaleHeight - m_HandleSize
    If hgt < 1 Then hgt = 1
    Corner.Move ScaleWidth - m_HandleSize, _
        hgt, m_HandleSize, m_HandleSize
    
    ' Position the contained controls.
    For Each ctl In ContainedControls
        ctl.Move 0, 0, ScaleWidth, hgt
    Next ctl
End Sub

The UserControl arranges the controls it contains so there is a small
gap at the bottom. That lets the UserControl show through and lets you
see the Corner PictureBox.

The UserControl tracks MouseDown, MouseMove, and MouseUp events on its
own surface, too. When you click and drag on the UserControl, the code
figures out where the control should be and calls Extender.Move to move
the UserControl appropriately.

The control also includes routines to save and restore size and position
in the Registry so the program can easily keep its size and position
between program runs.

See the code for additional details.
==========
++++++++++
<Both>
++++++++++
==========
2. New Links
http://www.vb-helper.com/links.html

CodeRush Xpress for C# and VB
http://www.devexpress.com/Products/Visual_Studio_Add-in/CodeRushX
A tool that adds a bunch of refactoring and software development
features to the IDE including: duplicate lines, highlighting references,
create overload, reorder parameters, and much more. Big drawback:
doesn't support Visual Studio Express Editions. (Ironic since the word
"Xpress" is in this product's name.)

Refactor! Pro for Visual Studio
http://www.devexpress.com/Products/Visual_Studio_Add-in/Refactoring
Refactoring tools for Visual Studio including: case to conditional,
extract method, For to For Each, create setter, etc. $99.
==========
Archives:
    http://www.topica.com/lists/VBHelper
    http://www.topica.com/lists/VB6Helper
    http://www.topica.com/lists/VBNetHelper

Post questions at:
    http://www.topica.com/lists/VBHelperQA
	
 Previous Message All Messages Next Message 
  Check It Out!

  Topica Channels
 Best of Topica
 Art & Design
 Books, Movies & TV
 Developers
 Food & Drink
 Health & Fitness
 Internet
 Music
 News & Information
 Personal Finance
 Personal Technology
 Small Business
 Software
 Sports
 Travel & Leisure
 Women & Family

  Start Your Own List!
Email lists are great for debating issues or publishing your views.
Start a List Today!

© 2001 Topica Inc. TFMB
Concerned about privacy? Topica is TrustE certified.
See our Privacy Policy.