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

Thread: urgent help!!

  1. #1
    Join Date
    May 1999
    Posts
    28

    urgent help!!

    hi,
    i have a dialog with many controls - some of which were placed by the resource editor and the others - through code using - SetWindowPos();
    the amazing thing is while in some computers it looks just fine, on others - it is a mess.
    any clue?
    oren.
    (i'm using vc5).



  2. #2
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    74

    Re: urgent help!!

    I think it is the problem of dialog base unit.
    Dialog uses different unit (not pixel) for the layout of its controls so as that the dialog looks good
    even the resolution of the screen is changed (actually, in many cases, it only makes the problem more complex).
    Please check GetDialogBaseUnits for more information.



  3. #3
    Join Date
    May 1999
    Posts
    28

    Re: urgent help!!

    hi and thanks,
    i tried your suggestion and it did something - it moved the controls to another messy position. maybe it is a part of the solution.
    any other idea?
    oren.


  4. #4
    Join Date
    May 1999
    Location
    Republic of Korea
    Posts
    74

    Re: urgent help!!

    I'm not sure how you did actually.
    But you must be aware that the size of the controls should be altered also.
    Hence if you have some controls such as displaying a bitmap of fixed size (in pixel units),
    they can cause a trouble.

    Another Idea:
    Ignore dialog unit altogether.
    In this case, you change the size of dialog box itself to your preference.
    And move all of your controls to a specific positions you designated.
    This may work in most cases.

    Good Luck !



  5. #5
    Join Date
    May 1999
    Posts
    28

    Re: urgent help!!

    Got it!
    It was the differenece between large and small fonts in the 'settings' tab of the 'display properties' of windows. but if so - why the convertion to dialog base units didn't help?
    anyway i made my own convertion by deviding the x,y dialog's client area dimenssions to the known dimenssions (when the controls are in the right position) and it seems to work just fine.
    thanks for the ideas,
    oren.


  6. #6
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: urgent help!!

    The dialogue base units control the POSITION of controls relative to the top-left - but they do not control the SIZE of the controls. The framework also changes the size of controls if the font size or screen resolution changes.

    --
    Jason Teagle
    [email protected]

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