none
vb.net desktop application increase size application when executing RRS feed

  • Question

  • I have a vb.net 2010 desktop application that I need to make a change to.
    When the application runs, it runs in some predetermined size. The users are not able to drag the width or length arrows to increase the size of when the application runs on their desktops. They would like to increase the size of theapplication since they cannot see some of the wording.

    Thus can you tell me what I can do:
    1. Increase the default size of the application when it runs on a users desktop? and/or
    2. Allow the user to adjust the size of the application when it is actually executing? Increasing the width and/or length of the application?

    Wednesday, August 16, 2017 1:56 PM

Answers

  • There are 42 forms to this application. Thus would I need to set Form WindowState property =Maximized, if you want your form to be seen on full screen, and set AutoScaleMode property=Font, AutoSize property=False,

    on all 42 forms?

    Wendy,

    42 forms? That's extraordinary.

    Do you mind if I ask what your program does?


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Wednesday, August 23, 2017 7:04 PM

All replies

  • Hi

    When you say the application 'runs in some predetermined size', I assume you are meaning that the application has been designed with a FormBorderStyle that doesn't allow user to resize the Form? If so, then alter that property to something that does allow the user to resize the Form.


    Regards Les, Livingston, Scotland


    • Edited by leshay Wednesday, August 16, 2017 2:04 PM
    Wednesday, August 16, 2017 2:04 PM
  • "They would like to increase the size of theapplication since they cannot see some of the wording."

    Sounds like you are using a different screen resolution when you fix the size of your form on your system? Then when run on another system, with different screen settings, your form is not the right size due to the text size dpi changing and or resolution setting on the customers system.

    So if you 1. increase your fixed size. You will need a size for all possible monitors dpi settings.

    If you 2. Allow the user to adjust size then what is the problem? Seems that is what you need to do unless there is some reason not to. That is how a windows application is supposed to work?

    If for some reason no. 2 does not work for you then you need to make your app dpi aware somehow and change the size of your app based on the current system dpi.

    https://msdn.microsoft.com/library/windows/desktop/dn469266.aspx?f=255&MSPPError=-2147217396

    https://docs.microsoft.com/en-us/dotnet/framework/winforms/automatic-scaling-in-windows-forms

    http://www.telerik.com/blogs/winforms-scaling-at-large-dpi-settings-is-it-even-possible-

    Wednesday, August 16, 2017 3:32 PM
  • Consider the third way too: allow the user to resize the form and also to scroll the contents. Set FormBorderStyle to Sizable and AutoScroll to True.

    Wednesday, August 16, 2017 4:00 PM
  • How do I find the FormBorderStyle? What option should I change the form to?
    Thursday, August 17, 2017 3:05 AM
  • Thanks for your answer!

    I have the additional questions:

    1. 'size dpi changing and or resolution setting on the customers system'. How do you change the size of dpi or resolution? Where do you find it?

    2. Can you tell me how to 'make your app dpi aware somehow and change the size of your app based on the current system dpi.'?

    Thursday, August 17, 2017 3:10 AM
  • Hi

    The FormBorderStyle is one of the properties of the Form and can be found in the property list when the Form has been selected (in the Designer view). Changing this to Sizable (assuming it isn't already) will allow the user to drag/resize the Form while the application is running.

    *

    Your question 1.above: dpi changing and or resolution setting - this is a setting of the computer as distinct from any application, and how to view/chamge it depends on the operating system in use. On my Windows 10 system, I can right click on the desktop and choose Display Settings - from there I can change the Scaling and Resolution (these changes effect all applications that run on the computer).

    *

    Your question 2.above: this is a bitmore complex to achieve. It is done in yourcode and  involves setting a vaiable to a Ratio for the current screen resolutionand then applying that Ratio to the controls on a Form, relocating and resizing them accordingly when the application is started on a computer with a different resolution. One example can be found HERE by IronRazerz and is the 5th post in the thread (although you would need to read most of the thread anyway)


    Regards Les, Livingston, Scotland


    • Edited by leshay Thursday, August 17, 2017 3:37 AM
    Thursday, August 17, 2017 3:31 AM
  • Thus can you tell me what I can do:
    1. Increase the default size of the application when it runs on a users desktop? and/or
    2. Allow the user to adjust the size of the application when it is actually executing? Increasing the width and/or length of the application?

    Hi wendy,

    About your first question, you can choose Form WindowState property =Maximized, if you want your form to be seen on full screen, and set AutoScaleMode property=Font, AutoSize property=False.

    Best regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, August 17, 2017 7:14 AM
    Moderator
  • There are 42 forms to this application. Thus would I need to set Form WindowState property =Maximized, if you want your form to be seen on full screen, and set AutoScaleMode property=Font, AutoSize property=False,

    on all 42 forms?

    Wednesday, August 23, 2017 6:56 PM
  • There are 42 forms to this application. Thus would I need to set Form WindowState property =Maximized, if you want your form to be seen on full screen, and set AutoScaleMode property=Font, AutoSize property=False,

    on all 42 forms?

    Wendy,

    42 forms? That's extraordinary.

    Do you mind if I ask what your program does?


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Wednesday, August 23, 2017 7:04 PM
  • This is all the beginning of school year reports that are needed for students. Each report a separate page for the student. This includes health forms, special education forms, insurance forms, nutrition supplemental forms that are needed, title 1 forms, homeless student forms. The forms are also unique by early childhood, kindergarten, elementary grades, middle school grades, high school grades, and alternative school. Not all forms are printed at the same time.
    Thursday, August 31, 2017 3:22 AM
  • This is all the beginning of school year reports that are needed for students. Each report a separate page for the student. This includes health forms, special education forms, insurance forms, nutrition supplemental forms that are needed, title 1 forms, homeless student forms. The forms are also unique by early childhood, kindergarten, elementary grades, middle school grades, high school grades, and alternative school. Not all forms are printed at the same time.

    Wendy,

    I assume you still need to solve this problem?

    Show us an image of one of the forms. How are they made in your app? Are they just a default form that has basic text box and checkbox controls on the form?

    Or is it a bitmap that needs to be resized or html or what exactly?

    How does the user access the forms? Pick from a list and the form is shown? How do you show and save the data on the form?  etc.

    How do you suggest the form be resized? Have the user drag the form border?


    Thursday, August 31, 2017 10:45 AM
  • I am just going to change the screens that are too big.
    Thursday, August 31, 2017 2:14 PM
  • I would allow the Forms to be resized and then try using the below Class:

    https://www.codeproject.com/Tips/1025766/VB-NET-Dynamically-Resize-and-Reposition-All-Contr

    Try it on one Form and then add it to others if it works for you. There are all sorts of methods you can use, including third-party controls that will handle it for you automatically, so this may be a simple solution if you have a lot of Windows Forms in your project.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Thursday, August 31, 2017 2:26 PM
  • I am just going to change the screens that are too big.

    Wendy,

    What you describe is, no doubt, a lot of work - especially if you had to do the whole thing all over again! I wish we'd talked before you got started but I'll toss this out anyway:

    If you can afford to spend some money on this, consider Dev Express. This is one way (it's not how I would set it up, but I've used it and it works). Have a look at this video:

    https://www.youtube.com/watch?v=odYs4zfiZwM

    In particular, near the end Amanda demonstrates what your users will see and how they can resize the forms for themselves. Their controls are all set up that you can persist state pretty easily.

    There are other ways: For example consolidation with a Tab Control, but I'll go back to suggesting Dev. This video show the NavBar being used along with a RibbonControl:

    https://www.youtube.com/watch?v=irNhFsCK__g

    Usually though, I'll set the NavBar up on the left and use their TabControl docked in a split container, consuming the lion's share of the the form on the right side. With theirs, I can toggle whether or not to show the tab headers (so I set it to false) and the navigation along the left then selects the active tab page which is then grouped logically into sections.

    If you wanted to, you could extend that concept by incorporating one of their newer controls -- the AccordianControl:

    https://www.youtube.com/watch?v=Gkty9XQcd-4

    *****

    You can see how doing this would cut down quite a lot on the number of forms you'd need.

    Food for thought. :)


    "A problem well stated is a problem half solved.” - Charles F. Kettering

    Thursday, August 31, 2017 4:03 PM