CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Apr 2009
    Posts
    1,355

    [VB6] - resolution by form and not by screen

    can i work with resolution by form instead by screen using API?
    (i have 1 code that works fiine, but it's by screen instead by form)

  2. #2
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: [VB6] - resolution by form and not by screen

    Not sure what you are asking.
    The resolution is related to the screen the form is displayed on the screen.
    You can change the size of the form but that has no effect on the screen resolution nor should it.

    You really should not try to change the resolution within your program anyway as it could lead to problems on various monitors.

    If you are writing a game or such that runs in full screen mode then it may be acceptable to have options within for different screen sizes but in a form based application this should not be the case.
    Always use [code][/code] tags when posting code.

  3. #3
    Join Date
    Apr 2009
    Posts
    1,355

    Re: [VB6] - resolution by form and not by screen

    Quote Originally Posted by DataMiser View Post
    Not sure what you are asking.
    The resolution is related to the screen the form is displayed on the screen.
    You can change the size of the form but that has no effect on the screen resolution nor should it.

    You really should not try to change the resolution within your program anyway as it could lead to problems on various monitors.

    If you are writing a game or such that runs in full screen mode then it may be acceptable to have options within for different screen sizes but in a form based application this should not be the case.
    but i you don't understand what i mean, i you the screen for change the screen resolution. but in window mode???
    what i can do is resize the form. but my problem is how can i calculate the controls positions and sizes by form size?

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [VB6] - resolution by form and not by screen

    There are tools that we used to buy that automatically re-sized the screen for you based on the desktop resolution. I needed it when my program was released to people that had 1024x768 when I wrote it in 800x600. Rather than re-write, I added a control to the form and BINGO. Don't think you can find them anymore, though.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Jul 2008
    Location
    WV
    Posts
    5,362

    Re: [VB6] - resolution by form and not by screen

    Like I said the resolution is related to the screen, not the form. If you want to resize objects on a form or a form itself based on resolution then the first thing is to check the screen size and then adjust the size of the form/controls as needed. I have saw controls to handle this in the past and I think there are some samples with code on the net for free download but I have never checked into them.

    As for calculating the sizes that is simple math you just have to take into account the screen size and from there the relation you want your form to be to the size of the screen and then the controls on the form.

    Your questions do not provide enough info to go any deeper into it.
    Always use [code][/code] tags when posting code.

  6. #6
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: [VB6] - resolution by form and not by screen

    Hence my post. This is old, when VB6 was king of the road! Re-size all controls on all forms for every screen isn't in VB6.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  7. #7
    Join Date
    Apr 2009
    Posts
    1,355

    Re: [VB6] - resolution by form and not by screen

    sorry... what i mean is:
    1 -in window mode, i can't change the resolution. because i must change the windows. that's why we use the the program in fullscreen and then we change the resolution screen
    2 - but instead resolution screen we use just the form size?
    we change the form size, then we change controls positions, dimensions, fonts and images. what i don't know is calculate the new position,dimensions and fonts.
    any advice?
    (sorry my english)

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured