Adjusting to screen resolutions

I am looking for the best way to have a dialog based program scale up and 
down to fully file the screen for several different screen resolutions.

I need to have the buttons stretch or compress so that the same number of 
buttons show in generally the same relative proportions.



Since this is an embedded application I could set some flags and compile a 
different version depending on the targeted display, if I have to. I would 
like to avoid having multiple versions of the project to maintain.



By the way would .net offer any help for this?



Thanks


0
5/31/2007 9:26:33 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
421 Views

Similar Articles

[PageSpeed] 20

On Thu, 31 May 2007 17:26:33 -0400, "Chris H"
<humme.chris@royalmaster.com> wrote:

>I am looking for the best way to have a dialog based program scale up and 
>down to fully file the screen for several different screen resolutions.

You might find this interesting:

http://www.codeproject.com/dialog/resizabledialog.asp

MrAsm
0
mrasm (715)
5/31/2007 9:46:22 PM
Override the dialog's OnInitDialog() function.

BOOL CMyDialog::OnInitDialog()
{
    int nScreenWidth = ::GetSystemMetrics( CM_CXSCREEN ); // Supported by 
WinCE
    int nScreenHeight = ::GetSystemMetrics( CM_CYSCREEN ); // Supported by 
WinCE
    MoveWindow( 0, 0, nScreenWidth, nScreenHeight, TRUE );
    return TRUE;
}

Override the OnSize() function.

void CMyDialog::OnSize( UINT nType, int cx, int cy )
{
  // Calculate the child controls' positions and call MoveWindow on each of 
them.
}

As for .Net, yes, there is an automatic way to position and resize controls 
on a form. You can set "Anchor" properties for controls in the design mode 
and not worry about coding to re-position/size controls. You still need to 
resize the main form programmatically  to fit to the screen.

"Chris H" <humme.chris@royalmaster.com> wrote in message 
news:OKkC3n8oHHA.3892@TK2MSFTNGP04.phx.gbl...
>I am looking for the best way to have a dialog based program scale up and 
>down to fully file the screen for several different screen resolutions.
>
> I need to have the buttons stretch or compress so that the same number of 
> buttons show in generally the same relative proportions.
>
>
>
> Since this is an embedded application I could set some flags and compile a 
> different version depending on the targeted display, if I have to. I would 
> like to avoid having multiple versions of the project to maintain.
>
>
>
> By the way would .net offer any help for this?
>
>
>
> Thanks
>
> 


0
5/31/2007 10:03:30 PM
Get the size of the current monitor.  Since it is an embedded application which likely has
only one monitor, this is straightforward.  Use SetWindowPos(NULL, 0, 0, cx, cy,
SW_NOZORDER) to resize the window.

Let's say you want 8 buttons across.  Then you divide the client area by 8, and this gives
you the width of your buttons.  Resize them; it's just arithmetic.  
				joe

On Thu, 31 May 2007 17:26:33 -0400, "Chris H" <humme.chris@royalmaster.com> wrote:

>I am looking for the best way to have a dialog based program scale up and 
>down to fully file the screen for several different screen resolutions.
>
>I need to have the buttons stretch or compress so that the same number of 
>buttons show in generally the same relative proportions.
>
>
>
>Since this is an embedded application I could set some flags and compile a 
>different version depending on the targeted display, if I have to. I would 
>like to avoid having multiple versions of the project to maintain.
>
>
>
>By the way would .net offer any help for this?
>
>
>
>Thanks
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
6/1/2007 12:57:56 AM
Reply:

Similar Artilces:

Price adjustments
I have a client that would like to adjust prices based on a markup scheme from cost. The scheme is as follows: If cost = $0.01 - $5.00, the markup is X%, if $5.01 - 25.00 then markup is y, ect ,ect. I figured I would use a SQL statament with the UPDATE command, but Im not exceptionally proficient in SQL, so could someone provide me with a SQL statement please? Thank you. Phil - before you decide to embark upon and join the dark side..... Have you tried using the inventory wizard? Run task 110 change item prices, select "filter" as your method, in the filter use "pric...

faq change the screen's graphics mode.
Hi, My screen now is 1152x864 with 85mhz. How to make my exe run at 800x600 and when it exit it can restore my old graphics mode 1152x864 with 85mhz? Thanks. > My screen now is 1152x864 with 85mhz. How to make my exe run at 800x600 >and when it exit it can restore my old graphics mode 1152x864 with 85mhz? Use the ChangeDisplaySettings API, or run your application via a utility that can do it for you (such as VidRes: www.jddesign.co.uk) Dave Hi, I did it. So now I post my code here , and hope it will be useful for someone. In your initia code add these code block: BOOL Cx...

unwanted: Zoom adjust when adjusting Print Scale
Would someone be willing to review the file and advise. when in Print Preview - if I adjust the print scale - then the zoom ( screen view ) adjust and not the printed view. I have several co-workers which have had the same issue happen to them. It has to be a file setting - as other excel files do not do this. When I go to Page Break Layout and try to drag the blue dotted line - nothing happens, it will not move - or - it moves and gives me an error "Margins do not fit page size" and I will get blue dotted lines around all cells and 100's of pages. Have you change the page ...

Pending Account Adjustments
I made a few account adjustments (credits) at HQ for a customer a couple of weeks ago. I just checked at the store level and the customer balance is not updated and the customer can't put items on his account because the credit limit is reached and the credits are not reflected at the store. I checked the customer account in the HQ database, and when I click on receivables, all credits appear as "(pending)" in the list. I don't understand what this means. Note: I closed the billing cycle up to today, and still no change. Help!!!! Think I figured it out... Need a 3...

making adjustment for the start bar on the side of the screen
I want my 2 windows to be tiled vertically. Window1 is on the left and needs 25% of the screen Window2 is on the right and needs 75% of the screen I've done this with something like the code below, but this doesn't take into account if the user has the start bar on the side. Is there a way to tell if it is, and how many pixels it's taking up? thanks, southernatheart lngHorizontal = System.HorizontalResolution lngVertical = System.VerticalResolution 'RESIZE THE EXISTING DOCUMENT Application.WindowState = wdWindowStateNormal Application.Move Left:=0.2 * lngHorizon...

how to set columns that will stay on screen?
I notice a few Excel files created by others have this feature that the first 2 columns at the left will not move when scroll it horizontally. The scrolling only starts column C. It's great for column or row with labels. How is it set? How to disable it? Thanks, On Apr 8, 5:04=A0pm, liu <spamfree...@yahoo.com> wrote: > I notice a few Excel files created by others have this feature that > the first 2 columns at the left will not move when scroll it > horizontally. The scrolling only starts column C. It's great for > column or row with labels. How is it set? How to di...

Desktop
Want to display a picture on Desktop but want it to have a decent size border around it. How do I do that? I've used control Panel/Display/Desktop/chosen a pic and used Position Centre...sometimes the pic appears exactly as required other times it takes up the full screen. How do I control the size of the pic to be displayed on the screen? Thanks. peejaa wrote: > Want to display a picture on Desktop but want it to have a decent > size border around it. How do I do that? > I've used control Panel/Display/Desktop/chosen a pic and used > Position Centre......

White Text on Screen, not visible on paper
In my Windows Appearance settings, I have a blue background with Whit Text. In Excel this appears as well. Whenever I try to print out spreadsheet, the White Text is invisible. Is there a way to tell Exce that the default color for printing is black rather than the scree color which is white. Excel seems to be working since with the darke background, white is the "AUTOMATIC" color chosen, however I don't wan to use white when I send it to the printer. Any suggestions Thanks IN Advanc -- mtrevin ----------------------------------------------------------------------- mtrevi...

Budget Adjusts when I add a bill
I have recurring payments set up for a monthly expenditure that happens on the first of every month. It just so happens that this month, the expense was $41 dollars over normal (the bill is normally $175). When I wrote the check for $216 and added it in, the Budget Summary adjusted my budgeted amount for this category by the difference. Here is the scenario: $300/ea. month set aside for Pet Care. $175 normally for Horse Board This month it was 216.13 Budget adjusted my $300 to $342 so that I have the normal monthly remainder of $125 left over. How do I correct this so that it goes back...

Formula Auto-Adjustment
Hello, I have a formula that references cells on another worksheet (say sheet1). The formula looks like this: =sum(sheet1:A1:A8) When I remove two rows (row 2 and row 3) from sheet1, the formula is adjusted automatically to: =sum(sheet1:A1:A6) However, this is not what I want. How do I keep the original formula sum(sheet1:A1:A8) even if rows are deleted? I tried sum(sheet1:$A$1:$A%8), but to no avail. Any help would be appreciated. Hi, Try =SUM(INDIRECT("'Sheet1'!A1:A8")) Be careful - your formula shows a ":" between the sheet name and the address it s...

10.6.2 fixes the "blue screening" issue
Just in case anybody didn't catch that. Really. It's fixed. (And all my users were very, very happy about that...) - Steve In article <101120090940061095%maser@umich.edu>, Steve Maser <maser@umich.edu> wrote: > Just in case anybody didn't catch that. > > Really. It's fixed. > > (And all my users were very, very happy about that...) I noticed that...no problems so far. It seems to have dicked up SlingPlayer. ...

Quantity Adjustment
Hi all, Can anyone advice me how to adjust items quantity in stores thru headquater manager? i tried worksheet style 307-adjust quantity items and it solved the matter by adjusting the items quantity one by one but i want to adjust ALL the items quantity in one time to 0 quantity, is this possible ?? advice me plz.. and thanks in advance :) Abba, Normally you would have the store update HQ as they should be more accurate. Process a 190 and then a 501. -- * Get Secure! - www.microsoft.com/security You must be using Outlook Express or some other type of newsgroup reader to see and dow...

Outlook clients adjusting server name to new server?
I will be migrating from an Exchange 2000 server to an Exchange 2003 server on new hardware soon and because I can not rename the new server to that of the old without causing heaps of problems I am going to go ahead and use a new name for the new server. The question I have is, will my Outlook clients (a mix of Outlook 2000 and 2003) automatically adjust their settings to connect to the new server name, or will I have to manually go around and change the setting on each client? I read on a forum somewhere along the line that it will happen automatically, but I can't seem to find a...

Graph Resolution
I have a graph on a report that only displays all the columns if the screen resolution is set to 1280X1024. Any other resolution cuts the graph off on the right. How do I get the graph to resize so it is all displayed no matter what the screen resolution is? ...

Total number of items in a sale should be displayed in POS screen
Before you tender a sale it is always a good idea to compare the number of items the customer is purchasing to the number of items rung in. If your customer is buying 10 items and only 9 have been entered, you want your salespeople to know this. RMS does not display the total number of items in a sale anywhere in the POS screen so verifying that all items have been entered is difficult and therefore not done. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree&qu...

Adjusting Items In HQ?
Hello folks, I have a client that is having a problem when she adjusts item quantities in HQ to go to a specific store. She (and I) would like to know what work sheet to use when adjusting items so that it is downloaded to the store and also show up in HQ. So here is her question: Where do I adjust item quantities so that it shows up both in HQ and in the store? Now here is what we have been using worksheet style 307: Adjust Item Quantities and then we filter it by pants and finish off the wizard. Now in the worksheet there is Qty and Adjust Qty By. If "Bargain Pants - Jr" h...

Vendor Name on the inquiry screen should match the V Card field
In the vendor lookup screen, the “vendor name field” is too short. This fields needs to be lengthened on the screen (perhaps the “additional sort field” should be shortened). ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/C...

Turn off auto adjust of row heights
I have a complex spreadsheet for my catalogue of products. I have set row heights, fonts and sizes of texts for different rows. Every now and then my row heights are automatically changed by EXCEL. I have turned off word wrap I have locked/protected my sheet. How can I stop EXCEL automatically readjusting row heights at its discretion. Thanks ...

increase adjustment cost (current) and decrease adjustment cost (F
We are in the process of getting ready to do our year end physical inventory count. We will be using the Stock Count functionality within GP and we have Multi-Bins enabled. We have a problem where we know that some significant inventory quantities are in the wrong BINs at the moment and will be corrected as part of the physical inventory count. I ran a test where I have an item that exists in multiple BIN locations but where the BIN quantities in GP were incorrect but the overall item quantity was correct. Example: GP has: Bin A = Qty 3 Bin B = Qty 4 Bin C = Qty 5 Total Qty = 12 Phy...

Spreadsheet creating Adjusted Cost Basis of Home Improvesments
I am a new users of Excel and want to set up a spreedsheet to track the home improvements on a home just sold to use for Adjusted Costs Basis with the IRS and State. Does anyone have such a spreadsheet. I need for it to be simple, because I am simple about these kinds of things. ...

How do I adjust marker spacing in Excel scatter plot?
I am creating a char in Excel 2007 with 2 data series. 1 data series (revenue) with left Y axis uses column chart and another series (growth) uses XY Scatter chart. Both of them use the same X axis values. The trouble is that the two don't align on X axis marker. Is there a way to adjust spacing between scatter markers to get everything align? Thanks Could you use a Line rather than XY? Or there is an option to have the columns line up x-axis labels rather than between them best wishes -- Bernard Liengme Microsoft Excel MVP http://people.stfx.ca/bliengme "ravi...

monitor brightness adjustment
I have a 2003 Dell Dimension desktop computer and flat-screen monitor. I'm running WinXP fully updated. Is there any way I can change the brightness (and contrast) with software, or do I have to do it on the monitor itself? I went through Display properties but couldn't find anything there. Thank you! Jo-Anne Jo-Anne wrote: > I have a 2003 Dell Dimension desktop computer and flat-screen > monitor. I'm running WinXP fully updated. Is there any way I can > change the brightness (and contrast) with software, or do I have to > do it on the monitor its...

macro adjust
I am running this macro in a spreadsheet which carries the numerical data entered in sheet A to Sheet B with (PO) before each entry. CURRENT MACRO RUNNING(WORKS PROPERLY) Sub Worksheet_Change(ByVal Target As Range) Dim zPO As String Dim u as Integer If Not Interest(Target, Range("A2:A9999)) Is Nothing Then On Error Resume Next zPO = "PO" & Right(Target.Value, Len(Target.Value) - 3) On Error GoTo 0 u = Sheets("Purchase Orders").Range("A65536").End(x1up).Row Sheets("Purchase Orders").Range("A" & u + 1) = zPO End If End...

Resources
I understand there is a feature in Great Plains where I can pull up any screen in eEnterprise and see what column and table that text box is linked to? Is this true? What are the steps to get this information? ...

My headers in Excel don't adjust with margin changes.
When changing default margins in Excel, the headers on the page don't adjust. Is it possible to have them follow the page size once my margins are adjusted? AB There is no way. They are stuck at about 3/4" Work-around is to "pad" the headers with spaces. You can move them inwards this way, but not outwards. Gord Dibben Excel MVP On Wed, 16 Feb 2005 06:49:04 -0800, "ABMIS" <ABMIS@discussions.microsoft.com> wrote: >When changing default margins in Excel, the headers on the page don't adjust. > Is it possible to have them follow the page ...