Displaying controls for different monitor display format settings

Hi,

I want to display a CButton (o_Verwijderen) control at the left bottom
of my form for all display formats.
I have :

void CTBURView::OnInitialUpdate()
{
	CFormView::OnInitialUpdate();

	ShowWindow(SW_SHOWMAXIMIZED);


	long x,y;

	x = ::GetSystemMetrics(SM_CXSCREEN);
	y = ::GetSystemMetrics(SM_CYSCREEN);


	CRect o_Rect;
	o_Verwijderen.GetClientRect(o_Rect);
	o_Verwijderen.MoveWindow(10,(int)(y*0.81),o_Rect.Width
(),o_Rect.Height ());


This works only for the highest display format setting 1280x1024 and
for 1280x960 but for lower settings the button moves of screen. How do
display my button relative to the screen format setting ?

0
nijenhuis (92)
8/28/2007 6:37:47 PM
vc.mfc 33608 articles. 0 followers. Follow

4 Replies
747 Views

Similar Articles

[PageSpeed] 46

How about this instead.

 CRect WinRect;
 CRect ButtonRect;
 GetClientRect(WinRect);
 o_Verwijderen.GetWindowRect(&ButtonRect);
 o_Verwijderen.SetWindowPos(NULL,WinRect.Width()-ButtonRect.Width(),WinRect.Height()-ButtonRect.Height(),0,0,SWP_NOZORDER|SWP_NOSIZE);AliR."RAN" <nijenhuis@wish.nl> wrote in messagenews:1188326267.891533.59500@r29g2000hsg.googlegroups.com...> Hi,>> I want to display a CButton (o_Verwijderen) control at the left bottom> of my form for all display formats.> I have :>> void CTBURView::OnInitialUpdate()> {> CFormView::OnInitialUpdate();>> ShowWindow(SW_SHOWMAXIMIZED);>>> long x,y;>> x = ::GetSystemMetrics(SM_CXSCREEN);> y = ::GetSystemMetrics(SM_CYSCREEN);>>> CRect o_Rect;> o_Verwijderen.GetClientRect(o_Rect);> o_Verwijderen.MoveWindow(10,(int)(y*0.81),o_Rect.Width> (),o_Rect.Height ());>>> This works only for the highest display format setting 1280x1024 and> for 1280x960 but for lower settings the button moves of screen. How do> display my button relative to the screen format setting ?>

0
AliR3470 (3235)
8/28/2007 7:28:32 PM
What happened to all carriage returns?

 CRect WinRect;
 CRect ButtonRect;
 GetClientRect(WinRect);
 o_Verwijderen.GetWindowRect(&ButtonRect);
 o_Verwijderen.SetWindowPos(NULL,WinRect.Width()-ButtonRect.Width(),WinRect.Height()-ButtonRect.Height(),0,0,SWP_NOZORDER|SWP_NOSIZE);AliR"AliR (VC++ MVP)" <AliR@online.nospam> wrote in messagenews:AH_Ai.30838$RX.15375@newssvr11.news.prodigy.net...> How about this instead.>> CRect WinRect;> CRect ButtonRect;> GetClientRect(WinRect);> o_Verwijderen.GetWindowRect(&ButtonRect);>o_Verwijderen.SetWindowPos(NULL,WinRect.Width()-ButtonRect.Width(),WinRect.Height()-ButtonRect.Height(),0,0,SWP_NOZORDER|SWP_NOSIZE);AliR."RAN"<nijenhuis@wish.nl> wrote inmessagenews:1188326267.891533.59500@r29g2000hsg.googlegroups.com...> Hi,>> Iwant to display a CButton (o_Verwijderen) control at the left bottom> of myform for all display formats.> I have :>> void CTBURView::OnInitialUpdate()>{> CFormView::OnInitialUpdate();>> ShowWindow(SW_SHOWMAXIMIZED);>>> longx,y;>> x = ::GetSystemMetrics(SM_CXSCREEN);> y =::GetSystemMetrics(SM_CYSCREEN);>>> CRect o_Rect;>o_Verwijderen.GetClientRect(o_Rect);>o_Verwijderen.MoveWindow(10,(int)(y*0.81),o_Rect.Width> (),o_Rect.Height());>>> This works only for the highest display format setting 1280x1024and> for 1280x960 but for lower settings the button moves of screen. How do>display my button relative to the screen format setting ?>>

0
AliR3470 (3235)
8/28/2007 7:30:00 PM
 CRect WinRect;
 CRect ButtonRect;
 GetClientRect(WinRect);
 o_Verwijderen.GetWindowRect(&ButtonRect);
 o_Verwijderen.SetWindowPos(NULL,WinRect.Width()-ButtonRect.Width(),WinRect.Height()-ButtonRect.Height(),0,0,SWP_NOZORDER|SWP_NOSIZE);

0
AliR3470 (3235)
8/28/2007 7:30:46 PM
"RAN" <nijenhuis@wish.nl> wrote in message 
news:1188326267.891533.59500@r29g2000hsg.googlegroups.com...
> Hi,
>
> I want to display a CButton (o_Verwijderen) control at the left bottom
> of my form for all display formats.
> I have :
>
> void CTBURView::OnInitialUpdate()
> {
> CFormView::OnInitialUpdate();
>
> ShowWindow(SW_SHOWMAXIMIZED);
>
>
> long x,y;
>
> x = ::GetSystemMetrics(SM_CXSCREEN);
> y = ::GetSystemMetrics(SM_CYSCREEN);
>
>
> CRect o_Rect;
> o_Verwijderen.GetClientRect(o_Rect);
> o_Verwijderen.MoveWindow(10,(int)(y*0.81),o_Rect.Width
> (),o_Rect.Height ());
>
>
> This works only for the highest display format setting 1280x1024 and
> for 1280x960 but for lower settings the button moves of screen. How do
> display my button relative to the screen format setting ?
>

Read the MoveWindow documentation carefully.  Its x, y parameters are with 
respect to the button's parent window, not with respect to the screen. So 
you should eliminate the GetSystemMetrics calls and use GetClientRect to get 
the height of the CTBURView. 

0
Scott
8/28/2007 10:49:04 PM
Reply:

Similar Artilces:

Copying a format that has been conditionally formated
How do I cut and paste a formula picking up it's own values if the cell has been conditionally formatted. In example, c3 is to highligh in red/bold if it's value is lower than c29 (the value of the same info from year prior). It worked for that cell but I want to copy the formula for the rest of the 500+ cells so that d3 also read from d29, etc. HELP!! What, exactly, is the condition you set? I'm guessing it's something like 'formula is' =($C$3<$C$29). If you use relative cell references, =(C3<C29), rather than the absolute references, then you should ...

Dual Displays
I want to connect my Sharp Aquos flat screen TV to my computer, and see my desktop on both the TV and computer monitor. Windows Vista Home Premium. HP Pavilion a1610n computer. Galaxy GeForce 8400 GS graphics card, outputs: 1-VGA, 1-DVI, and 1-SVGA. There is no HDMI port on the card. I connected a VGA cable between the motherboard "on-board" VGA port and the TV, figuring that I could use that output to work with the TV. The computer monitor is plugged into the GeForce graphics card. Tried the Desktop "Display Setting". It says, the number 2 monitor is "N...

How do you do set up a hierarchy chart in PP 7
I'm trying to set up a hierarchy chart in PP7 but the template presented doesn't allow me to add boxes below with a direct line. Sometimes I get a slanted line and I can't delete it. ...

Folder could not be displayed
I am running Windows XP and Outlook Express 6 just fine then one day my husband does something to my computer and his email account won't work. My email is working just fine but in his he cannot open his inbox. It says folder could not be displayed, and when you send and receive it gives you this error message: "An unknown error has occured. Account: 'incoming.verizon.net'. Server:'incoming.verizon.net'.Protocol:POP3, port: 110, Secure(SSL): No, error number: 0x800C013B" If anyone could help me with this I would greatly appreciate it. Thank you T...

Display a message box "this entry is a duplicate"
How can I display a message box on a form if the shipment number is a duplicate? I need a message box to pop up when user attempts to tab out of the field. Thank you. Something like: Private Sub txtShipNum_BeforeUpdate(Cancel As Integer) If DCount("*", "MyTable", "ShipNum = '" & Me.txtShipNum & "'") > 0 Then Msgbox Me.txtShipNum & " already exists." Cancel = True End If End Sub This assumes that your text box is named txtShipNum, that the name of the field in table MyTable is ShipNum...

how to display values in 3 cells into one cell
Anyone can help me how do I display the 3 separate different values in 3 cells into just one single cell ? thanks so much in advance. Either there was a typo or there's an echo in here. That line should have been: = A1 & " " & B1 & " " & C1 "Bradley Dawson" <bradleydawson@earthlink.net> wrote in message news:l464b.2224$Lk5.2093@newsread3.news.pas.earthlink.net... > In the target cell, type: > > = A1 & B1 & C1 > > where A1, B1, C1 are the cell addresses that you want to concatenate. > > If these have number...

How to select & display distinct values
Hello, I need help with a form please. My form has two controls, the first being a combo box. This box should select the company name from a lookup table. The lookup table has only two companies in it, however, they each are repeated several time. Company 1 has about 10 rows, company 2 has 3 rows. I used the query builder and came up with the statement: "SELECT DISTINCT Lktbl_Role_Master.CompanyName FROM Lktbl_Role_Master;" When I run the statement directly from query view, it executes perfectly and returns exactly two rows (one for each company, in a datasheet view) ho...

Conditional Formatting
I need to change the fill color based on the values of other cells. Ex. if A1 is not a null value and the cell I want to format A2 is a null then I need A2 to have a red fill color and a certain text. If A2 isn't a null then it should turn green. If A1 and A2 have null values then A2 should be yellow. So just to sum up A1<>"" and A2 ="" then Make A2=Red Fill Color + text A1<>"" and A2 <>"" then A2=Green Fill Color A1="" and A2 ="" then A2=Yellow Fill Color Thanks for the help all. What version of Ex...

Display Time in Outlook
The time setting in my Outlook is one hour behind my actual time. I cannot determine how to change the time. Outlook is the only item that is incorrect. Other display times in operating system are correct. Thanks, Jodi ...

PK and FK Displayed
I am a complete Visio newbie, and cannot find the answer I need in books or online help. I am trying to create ER diagrams from scratch, and not connected to real tables, using VEA. I have added tables ('Entities') to the form, connected them with a Relationship connector, and, in the Database Properties window I've assigned the end points to a Primary Key on the left and a Foreign Key on the right. But the model shows the connector as running between the top colums on both sides, whereas I want the keys to be in that upper box and provide the connector's end points. Wh...

Money 2007 -- QIF import
Good Evening! After a little trial and error, I am able to import account transactions from another system (not a bank statement, my actual register transactions) with little trouble except for the date format. (Before someone gets mad at me, I really don't think this has anything to do with my regional settings!) As recommended by an MVP from this forum, I open my CSV file with excel, then use a converter (add-in) called XL2QIF to create a qif output file. The actual "data" in a date field in my original csv file is "060106" (mm/dd/yy) which is June 1, 2006,...

Derived a class from a Control and put it into a Dlg
Hello, Newsgroupians: In regards to a previous post, I am now working with CFormView, and I'm enjoying the flexibility and robustness of the document / view architecture although I'm rather new to it. I've a question that's been plaguing me though. The CFormView class creates a dialog resource for me, which I like. However, I have a class that is derived from CButton that I would like to add to the form. CPSButton is the button's class name. Currently, I am adding it programmatically. Is it possible to add a button to the canvas and tell the program, "Yea...

How to change default formatting
How can I prevent Excel guessing what it thinks I want to type in a cell (mainly text). If I type in 1/2 it thinks I want 1st February 2003, but I just want "1/2" If I type in MAR01 it thinks I want 1st March 2003 but I just want "MAR01" etc etc Its a real pain! I knew about that one thanks. However I want to avoid having to do that every time. Any other ideas? -- "Kevin Stecyk" <stecyk@nohotspammail.com> wrote in message news:OGhujJanDHA.2732@TK2MSFTNGP11.phx.gbl... > Ian, > > Try preceding the "text" with a single ' (apost...

Formulas are displayed, results are not
Hello, For some reason, when I enter a formula into a cell and press enter, the formula just stays there. Anyone know what I can do to show the results? I tried pressing Cntrl + `, but that didn't work. FYI, when I cut and paste a column from a separate workbook, that column works like normal (i.e., the formulas produce results). Thanks for any suggestions! Hi Mike, Maybe your cell is preformatted as Text. Try formatting to general then erase your = and type it in again. HTH Martin "Mike C" <js2k111@yahoo.com> wrote in message news:f699bcd4-ad82-4a88-9759-5638c147b...

Putting the resources of different projects togehter in the masterproject
hi, i maintained the resources in individual projects through manuall insertion of each department. The resources arent broken down to collegues, but are on a department level (like 10people form department ZZ) and there is no database behind. Now i wanted to unite these "sub"projects in a masterproject. Therefore, i inserted the individual projects and linked them with the masterproject. At them moment, i am facing the problem, that MSP doesnt sum the hrs of the resources up. EG. NOW: Project Resource Hrs ------------------------------- Sub A ...

Stop displaying a line
I have a line graph/chart and it gets its values using a formula and the values of another column. However this poses a problem because if there is nothing in the targetted column the formula returns 0 cause the line to drop to the bottom, instead of casuing the line to just end until a value is added to the target column. How can I do this? Change your formula to use NA() if the cell is empty. For example: =IF(A1="",NA(),A1) To hide the resulting #N/A errors on the worksheet, you can use conditional formatting. There are instructions here: http://www.contextures.com/xlC...

Control Codes
I am printing labels using an old Datamax label printer that requires the STX (hex o2) control code to start the label format. RMS seems to strip this out. Has anyone had success in sending Printer control codes to the label file? Tried CHR$(02) but it did nothing. ...

A question about Console window(display or not display)
I've redirected the (stdin stdout stderr) of a console window process I spawned to a pipe. And I want to display the redirected console window, the question is: If I display it(set Create_new_CONSOLE in createprocess and some flags in startupinfo), I cannot use the redirected way of pipe, which means if i do not display, i can use the pipe communicating with the child process. Does it mean that as long as I disply the console window, windows will change stdin stdout to "screen&keyboard" instead of my pipe? That's right. If you redirect stdin or stdout then you preemp...

unattached textboxes disappear when a msgbox is displayed on a tab control
I'm using Access 2003. I have a form with a tab control on it. I was having problems with labels flashing and I followed the suggesting from Allen Browne - http://allenbrowne.com/ser-46.html. The flashing went away but now when a msgbox is displayed the unattached textboxes that I'm using as labels disappear. They come back as soon as the msgbox is removed from the screen. I've searched google looking for an answer but have come up short. Does anyone know why I'm experiencing this behavior and how to make it go away? Thanks, Rick That *is* strange. Have you tr...

Display or not display series
I have a graph with four series but some of the series may be blank, i.e. the series name is <blank series>. Is there a way to not display these series on the graph and/or legend if they are blank, and display them if they are without deleting the series? Thanks! Clay Create a chart from all the data Select the data on which the chart is based. Choose Data>Filter>AutoFilter In the heading cell for the series name column, select (NonBlanks) from the dropdown list The series with blank name cells will be hidden in the chart. Clay wrote: > I have a graph with four serie...

does Excel support multiple display monitors?
Hello All Excel Experts How do I move chart windows to multiple display montors?? (one computer runnng three monitors... Excel Charts will not move off the primary monitor. Your advice is EXTREMELY appreciated thanks. Denni ...

Conditional Formatting 12-16-09
I am trying to take a conditional formatted cell and take the formatted color to another cell. Like if John Doe completed something on 12/15/2009. I would like to have the formatted color of John Doe's cell carried to the 12/15/2009 cell. Any help would be appreciated. -- Suzi K Not sure what you are doing, but you can try this: right-click > copy > paste special > formats > OK -- Ryan--- If this information was helpful, please indicate this by clicking ''Yes''. "Suzi K" wrote: > I am trying to take a conditional forma...

Applications of Excel in different industries
I am working on a school project and need different Excel applications used in different industries and if possible names of companies. Thank you. Mary C. I work in the telecom industry. My department uses excel for a whole boat load of different things. From doing equipment pricing/costing, to help with calculations during engineering. One of the common functions that I use it for is to take data from disparate sources and to combine them into a workbook that others can play what-if scenarios. We take data from the AS/400 (MACPAC), mainframe (engineering files), UNIX (dumps of custome...

Displaying an equation
I have an equation setup that is referencing a few other cells that have equations in them. I want to have a cell that displays this equation with the answers that are calculated from these other cells displayed as values in the new equation. Any help would be greatly appreciated. Thanks Check out http://www.mvps.org/dmcritchie/excel/formula.htm#getformula In article <E4143E2B-360A-4B43-955F-73BF8EC60694@microsoft.com>, "hoising8" <hoising8@discussions.microsoft.com> wrote: > I have an equation setup that is referencing a few other cells that have > eq...

Serialisation
A general query Im serialising a person object with the following member variables Class Person Private _forenames As String Private _surname As String Private _dob As Date Private _marital_status As MaritalStatus 'Public Get and Set Properties here for each of the above ' I'll not detail them all to save space but Ill show attributes <XmlElementAttribute(Elementname:="forename")> _ <XmlElementAttribute(Elementname:="surname")> _ <XmlElementAttribute(Elementname:="dob"...