dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Move method

  1. #1
    Join Date
    Apr 2002
    Location
    Los Angeles, Ca
    Posts
    238

    Move method

    Hi everyone,
    I have a form that uses 25 textboxes and at leatst 20 sepertate labels, frames, option buttons ...etc. i found on this site a link to a really great program that makes any form re-sizeable. it works great ! Should anyone want the link, let me know, i will post it.

    Anyway, that program only works in run-mode, not design mode.
    In designing this form I have run out of height room, so to get the remainder of the controls on the form and programmed, i had to place them wherever I could find room.
    I now need to figure out how to use the MOVE method, to get the contrls where I need them in Run-mode. Lets say they are textboxes 24,25 & 26 and labels 20,21 and 22.
    I tried on the Form-load event to use something like this....

    Form_Load()
    TextBox 25.move 2800, 700
    TextBox 26.Move 3000,700

    etc, etc....
    That is not the exact code and i do not get any errors, so I know that portion of the code has the proper syntax.
    When I run this, the controls that I just had move are not visible anywhere on the form !!! Even though, I still have several inches of room to scroll down on the form.

    Any suggestions ?

    Michael

  2. #2
    Join Date
    Feb 2001
    Location
    Stamford CT USA
    Posts
    2,167
    Try the .LEFT and .TOP properties instead.

    -Cool Bizs

  3. #3
    Join Date
    Apr 2002
    Location
    Los Angeles, Ca
    Posts
    238
    Cool Bizs,
    I tried setting those proerties and it will not allow me to set them any larger than what my system monitor is. and belive me, it is OLD, SLOW and LITTLE, while my client had this brand new 20+ inch, flat screen LCD super wonderful monitor.

    So, the max i can set the .Top property to during design time is
    8400. But in run -time using this code I found, I know that the actual screen size is well over 10,000 (probably more). I really need that room, or I am going to be forced to use MDI forms, and show those if certain criteria is met.
    That is simple enough, but it would sure be nice to figure out a way using the move method(or something similar) to "trick VB" into allowing me to place controls below what it thinks is the lowest possible limit of a form.

  4. #4
    Join Date
    Apr 2000
    Location
    South Carolina,USA
    Posts
    2,210
    How about an alternative approach in that you make your form scrollable.
    The attached sample program uses the Forms Scrollbars to do just that. You can have many controls outside the Viewport and the user can scroll down or up at willl.
    Attached Files Attached Files

  5. #5
    Join Date
    Apr 2002
    Location
    Los Angeles, Ca
    Posts
    238
    That program is the exact one I previously downloaded and am using. The problem is it will not allow me(or I cannot figure out how) to place controls during design time below the max. height available for my form. have you ever used that program and know how to accomplish that ? My problem is during design time only right now.

  6. #6
    Join Date
    Sep 2001
    Location
    IL, USA
    Posts
    1,090
    Form_Load()
    TextBox 25.move 2800, 700
    TextBox 26.Move 3000,700

    etc, etc....
    TextBox 25 is an illegal name for a textbox. There should not be a space between TextBox and 25. Try:
    TextBox25.Move 2800, 700
    TextBox26.Move 3000,700

  7. #7
    Join Date
    Apr 2002
    Location
    Los Angeles, Ca
    Posts
    238

    I got it !!

    First and most importantly
    Thanks to everyone for all the help and suggestions.

    Secondly, that scrollform program is wonderful ! My sincere gratitude to the author of it. If anyone ever needs to accomplish this same sort of form design, I recommend you consider using that program. Mr. John Duffy posted a link to it :-)

    Finally, the way to place a control below (or beyond) the visible limits of a form, turns out to be very simple. In design mode, VB will NOT allow you to place a control then DRAG it beyond those limits, but it WILL allow you to place the control then move it by holding the CTRL key and moving it using the keyboard arrows, and the X Y coordinates are displayed on the VB toolbar next to the Visual Component Manager button. Go figure.

    So its off to form design and coding for me !

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)