Sizing forms in Visual Basic.NET...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mark

    Sizing forms in Visual Basic.NET...

    Here's the most concise description I can give you of my
    problem...

    I'm trying to create a narrow form in Visual Basic.NET
    2003. The form is about 95 pixels wide by 325 long. I
    resized it to these dimensions in the development
    environment. I've set the FormBorderStyle property to
    FixedSingle. I've set controlbox, minimizebox, and
    maximizebox to false because I don't want the form size to
    be tampered with, and because I want to make room for a
    title. So far, so good. However, when I run the code in the
    development environment or compile it and run the
    executable, my form will not maintain the dimensions I
    originally set. The height is fine, but the width increases
    about 75% to about 150 pixels as a best guess. I've tried
    setting the width programatically , but it still pops up to
    this minimum value. If I widen the form beyond this value,
    everything is fine--the dimensions stay as I set them, but
    if I go anywhere below this minimum value the width pops
    right back up again. This goes for FixedSingle, Fixed3D and
    FixedDialog border styles. The FixedToolWindow style seems
    to work ok, but that's not the border style I want. I've
    created forms in VB 6.0 with exactly the same dimensions
    and property settings, and never had any problems.

    I tried to fix the problem by fiddling with the minimumsize
    and maximumsize properties, but this just created another
    problem. By default, the minimumsize and maximumsize
    properties are set to 0 width and 0 height. I decided to
    set the dimensions for both these properties to the same
    dimensions as my form. Sure enough, when I ran my code the
    form came up with the correct width. However, when I tried
    to drag the form around the desktop, it was like trying to
    drag around an oil tanker. The form was heavy and choppy as
    I moved it. There was a lot of lag between the movement of
    the mouse and the positioning of the form. It was very
    noticable.

    The bottom line is that when I'm above this minimum width
    value, which in my case is about 145 to 150 pixels,
    dragging is sharp and responsive. When I manage to coax my
    form width to below this minimum value, dragging is heavy
    and lagging.

    Something's wrong here. I shouldn't have to "coax" my forms
    to any width setting I want, and I shouldn't have to deal
    with performance problems "depending" on that width setting.

    I've updated to Studio.NET. Now, for reasons I've outlined
    above and others, I wish I had my old Studio 6.0 back. I'm
    kicking myself for that one.

    I encourage anybody out there with access to Studio.NET to
    try to reproduce these problems, and then you'll see what I
    mean.

    If anybody has a fix, I'd love to hear from you. I've spent
    too much time on this prob. already.


    mark
Working...