Thread: Centering

  1. #1
    Registered User
    Join Date
    Jan 2005
    Posts
    204

    Centering

    Take a look at the attached picture please. I was able to create a dialog box like that but I had a really hard time trying to center everything. I was wondering if you guys could tell me an easy way to handle this. Thanks.

  2. #2
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Are you creating the dialogue box with a resource editor or are you doing it during run time by creating the controls yourself?

    edit - Do the larger boxes that the controls sit in represent child windows to the main window?
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  3. #3
    Registered User
    Join Date
    Jan 2005
    Posts
    204
    I use a resource editor.

    The outer box is the dialog box itself. The other large boxes are GROUPBOXes.

  4. #4
    Handy Andy andyhunter's Avatar
    Join Date
    Dec 2004
    Posts
    540
    Well the resource editor should have a grid view that should make everything pretty easy to center, it is WYSISWG editing after all.

    If that doesn't suit your needs you could always iterate through your controls during the DialogBox creation (in your DialogProc) and use MoveWindow to center them using code.
    i don't think most standard compilers support programmers with more than 4 red boxes - Misplaced

    It is my sacred duity to stand in the path of the flood of ignorance and blatant stupidity... - quzah

    Such pointless tricks ceased to be interesting or useful when we came down from the trees and started using higher level languages. - Salem

  5. #5
    Registered User
    Join Date
    Jan 2005
    Posts
    204
    Hey, sorry. What I meant is that I am writing the resource file myself using Notepad

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 4
    Last Post: 12-02-2006, 04:09 PM
  2. Centering Wizard?
    By JoeCoder in forum Windows Programming
    Replies: 7
    Last Post: 01-21-2004, 03:56 PM
  3. Centering on the screen
    By Dan in forum C Programming
    Replies: 8
    Last Post: 01-17-2004, 09:37 PM
  4. centering a dialog box
    By zolo44 in forum Windows Programming
    Replies: 4
    Last Post: 09-20-2003, 09:05 AM
  5. Centering text
    By Unregistered in forum C++ Programming
    Replies: 12
    Last Post: 10-04-2002, 11:58 PM