Can I automatically resize all controls in a Dialog without adding user codes

Dear All,

Can I design a Dialog that automatically resizes all controls when the 
Dialog is being resized?

Many thanks, 


0
y.xu (14)
5/2/2006 1:27:51 PM
vc.mfc 33608 articles. 0 followers. Follow

6 Replies
914 Views

Similar Articles

[PageSpeed] 7

Yes.  You can resize or move them as you wish by handling OnSize of the
dialog. SetWindowPos can be used to change the size and/or position.
Here is a helpful link:

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

---
Ajay

0
ajaykalra (6842)
5/2/2006 1:36:04 PM
No.  You must explicitly take action on the OnSize handler to resize them.  Sometimes,
there are packages called "geometry managers" that make this fairly straightforward (check
www.codeproject.com and www.codeguru.com for examples).  But there's no way to do it
automatically.
				joe

On Tue, 2 May 2006 14:27:51 +0100, "Y Xu" <y.xu@qub.ac.uk> wrote:

>Dear All,
>
>Can I design a Dialog that automatically resizes all controls when the 
>Dialog is being resized?
>
>Many thanks, 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
-- 
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth
0
newcomer (15975)
5/3/2006 2:13:10 AM
In that way I have to put my own codes. Actually I want Controls have the 
option "AutoSize" which I can easyly select in Resource Editor. Is it 
possible to achieve that?
"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
news:1146576964.233757.240480@i39g2000cwa.googlegroups.com...
> Yes.  You can resize or move them as you wish by handling OnSize of the
> dialog. SetWindowPos can be used to change the size and/or position.
> Here is a helpful link:
>
> http://www.codeproject.com/dialog/resizabledialog.asp
>
> ---
> Ajay
> 


0
breezexuyc (12)
6/8/2006 11:30:57 PM
Yuchun Xu wrote:
> In that way I have to put my own codes. Actually I want Controls have the
> option "AutoSize" which I can easyly select in Resource Editor. Is it
> possible to achieve that?

No. You will need to do that yourself. MFC does not have anything like
this built in. I am not sure if it makes sense to have autosize on a
control; anchoring is a better chioce.

----
Ajay

> "Ajay Kalra" <ajaykalra@yahoo.com> wrote in message
> news:1146576964.233757.240480@i39g2000cwa.googlegroups.com...
> > Yes.  You can resize or move them as you wish by handling OnSize of the
> > dialog. SetWindowPos can be used to change the size and/or position.
> > Here is a helpful link:
> >
> > http://www.codeproject.com/dialog/resizabledialog.asp
> >
> > ---
> > Ajay
> >

0
ajaykalra (6842)
6/9/2006 2:00:09 AM
No.
			joe

On Fri, 9 Jun 2006 00:30:57 +0100, "Yuchun Xu" <breezexuyc@ntlworld.com> wrote:

>In that way I have to put my own codes. Actually I want Controls have the 
>option "AutoSize" which I can easyly select in Resource Editor. Is it 
>possible to achieve that?
>"Ajay Kalra" <ajaykalra@yahoo.com> wrote in message 
>news:1146576964.233757.240480@i39g2000cwa.googlegroups.com...
>> Yes.  You can resize or move them as you wish by handling OnSize of the
>> dialog. SetWindowPos can be used to change the size and/or position.
>> Here is a helpful link:
>>
>> http://www.codeproject.com/dialog/resizabledialog.asp
>>
>> ---
>> Ajay
>> 
>
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15975)
6/10/2006 4:48:00 AM
have a look at www.codeproject.com/dialog/easysize.asp!

kind regards
--
Michael Buechel

while (!sleep())
   sheeps++; 


0
Michael
6/12/2006 3:14:02 PM
Reply:

Similar Artilces:

user initials and auto correction
Hi, Can someone please help me with the following...? People usually type JD in the To: field when they want to send me an email via Outlook. After a recent addition and deletion of another account with the initials of JD I'm finding that it is default to this user - and it's not even trying to qualify the correct recipient with a list of possible users, like it does with other similar users. I would like it to ask for qualification and also default to my account. Any ideas anyone? Thanks, Joe "Joey D" <joeydocherty2404@hotmail.com> wrote: >Hi, > >Can...

How can I know which SP has been put on the exchange2K
Where can I see this msg? Thanks Open exchange manager, organization, right pane. "Geoffrey" <yile1978@hotmail.com> wrote in message news:uvLLBUYwFHA.3312@TK2MSFTNGP09.phx.gbl... > Where can I see this msg? > Thanks > check www.petri.co.il or check for the answer on the 10th(9th from ur posting)thread on this site,that is named"finding on version of sp installed" ...

Save formatted text from RichEdit control to rtf-file
Hi , How can I save the text from Rich edit control (2.0) to *.rtf , *.txt , *.doc I tried to get the buffer and putting the buffer to file, then saving the file but the text in the file is something different. Please let me know what to do? Here is the Code I ma using: mFile.Seek( 0, CFile::begin ); CString cBuffer2; int iTotalTextLength = m_oChatMessageControl.GetWindowTextLength(); HWND focusWnd = ::GetFocus(); m_oChatMessageControl.HideSelection(TRUE, TRUE); m_oChatMessageControl.SetSel(iTotalTextLength, iTotalTextLength); cBuffer2 = m_oChatMessageControl.GetSelText(); LPTSTR...

Day of week time control
Let's say I wanted something to occur at specific times (via DDE) on Sunday, a different thing on Monday -Tue, Wed, Thurs, Fri Sat and continue over and over. I see how I can know the day and time, but to use it in a formula escapes me. The use is for a simple area based light control in my house. Hi Vernon Maybe =IF(AND(WEEKDAY(NOW())=1,HOUR(NOW())>=8,HOUR(NOW())<=17),"Switch on","Switch off") -- Regards Roger Govier "vernon" <there@there> wrote in message news:%23gF0dmcrHHA.1404@TK2MSFTNGP03.phx.gbl... > Let's say I wanted ...

How can I print just the flip side of a booklet?
How can I print just the flip side of a booklet? I printed the first side just fine and then my computer went funny and I had to shut down and start back up again. I have 25 copies of the first side that need to be printed on the back side. Pub 2000 user here: There may be a better way but I think you will have to print a page at a time i.e., File, Print Page 2 of 2; then 3 of 3 and so on. -- Don Vancouver, USA "pqc18" <pqc18@discussions.microsoft.com> wrote in message news:92653E8D-9772-4AE0-A9C3-514B363E72B2@microsoft.com... > How can I print just the flip side ...

converting tabular structures in a Word document into an actual table or reading data from the tabular structures using VBA code
I have a macro which can read the last cell/column of all tables in a Word 2003/2007 document and store the data in an MS-Access table. But, some Word documents have the data in structures like a table format but are not actually tables. The structure looks like a table, but the table borders are actually line connectors. These documents were created by a software(VeryPDF PDF to Word converter) which converted the PDF documents(the original format these documents were) into Word documents. 1. Is there a way I can convert/replace the tabular structures with actual tables in Word so t...

Controlling multiple TCP connections from Outlook 2003 clients
I've noticed that Outlook 2003 clients can have multiple TCP connections to the mailbox store on Exchange. As the following web link claims: http://www.windowsitpro.com/Article/ArticleID/46319/46319.html "This behavior is by design. Outlook can open multiple connections to parallelize its data communications with the Exchange server. The actual number of connections will vary according to the version of Outlook that you're using and the mode in which you're using it. For Microsoft Office Outlook 2003 in Cached Exchange Mode, you'll see four connections for the mailbox, ...

automaticly create graph
what i would like to do is create a spread sheet where by i entered the fixed and variable costs as well as the selling price. i would then like a graph to automaicly change and display the this info. Does anyone know how to do this. Decide which cells on the spreadsheet you wish to include in the chart. Select those cells. Follow the menu option: Insert/ Chart, and answer the questions in the wizard. Have you looked in Excel help at the topics concerned with charts, starting with "Create a chart"? Have you looked at the training material under http://office.microsoft.com/...

How to make a Add key disabled after adding one record unless
Hi, I have a form where I am adding records. There are two boxes where one has to put the lineitemnumber and another box where one has to put the description. Unless the above two boxes are filled in the Add command box need to be disabled. Now, the problem is after adding one record the Add button is enabled and I cannot disable it. I would appreciate any help to solve this. The error message is: The methos is not supported The following is the code: Private Sub cmdadd_Click() On Error GoTo Err_cmdadd_Click If (IsNull(Me.LineItemID) = True) Or (IsNull(Me.Description) = True) Then ...

disable Review toolbar which came up automatically when opening a.
How can I disable the Review Toolbar which comes up automatically when opening a file? In the Workbook VBA actions. The top left hand corner there is an Excel logo, not the one in th blue program bar, but in the menu bar. Right Click and select "View Code" There will be two drop down boxes one that will probably say General if this has never been entered previously. Change the box on the right to Workbook. Then Change the right hand box to "Activate" Insert the following code Application.CommandBars("Reviewing").Visible = False exit the VBA screen and t...

outlook can't receive exe files
A guy here at work can't get exe files through his outlook. Is there a check to uncheck somewhere to allow it to do this? He can receive normal attachments. ...

RMS Status Codes
Just wondering if anyone has a list of what the RMS Batch.Status codes 0-15 mean? I can't find them defined anywhere. I'm specifically looking at how to identify Blind Closes so I don't count them in totals until they'e been closed. Thanks! -Zim There is a Knowledge Base Article that covers the different Batch Status codes from 0 - 31. Just search for 'batch status codes' -- Robert Armstrong RMS Systems Inc. www.retail-pos.com "Zim" <Zim@discussions.microsoft.com> wrote in message news:C72515DB-AD45-4C7D-B8DE-0A18E4A6D0D0@micr...

How Can I Control When Messages are Downloaded from Server
I have the box "Check for messages every ___ minutes" unchecked (tools/options/general). Yet seemingly randomly, messages get downloaded a couple of times a day without my clicking "Sync." This is problematic due to the way I share the computer. Is there another setting I need to keep this spontaneous downloading from occurring? "Gripper" <Gripper@discussions.microsoft.com> wrote in message news:F22A9D3A-AFB5-4C85-B94B-79B109E4829E@microsoft.com... > I have the box "Check for messages every ___ minutes" unchecked > (too...

How can I sort duplicate text data in excel?
I have a large list of noames that I need to make sure that none of them are duplicated. Is there a way to have excel check it quisker than me reading every name until I find a duplicate? After selecting your data go to filter Advanced filter and check "Unique records only" You can even copy it to another area all uniques entries if you want to ... "TinaScheu" <TinaScheu@discussions.microsoft.com> wrote in message news:0399D580-7E69-4DF0-A969-E7FC5F777C70@microsoft.com... >I have a large list of noames that I need to make sure that none of them >are >...

"x" button enables deletion.... can we put a focus trigger there?
Hi, on three forms, I put focus triggers on the "delete" button because I need to validate some additional data before allowing the user to delete. However, if the user clicks on the corner "x" button to close the form and gets the dialogue box saying they have changes, do they want to "Save", "Delete" or "Cancel", they can delete the record anyways. Is there any way to put a focus trigger on the button of the dialogue box, or on the "x" button? Thanks in advance. I assume you are working with Dexterity. To work with an add...

Need code snippet to read offline PST file
Hi friends, I have a PST file in my local hard disk and have requirement to read PST file and parse through all folders and then each message item in all folders and then segregate them to different folders based on subject line. Please kindly send the code for the above requirement. Thanks & Regards Ramesh -- ramserp You're going to have to write your own code. Do you know anything about Outlook programming at all? You can start out by looking at information and code samples at www.outlookcode.com. -- Ken Slovak [MVP - Outlook] http://www.slo...

Vb.net 2008 ContextMenuStrip logical error when running code
Greetings, I have a connectmenustrip item that when clicked runs the following code (see below) Now if the event is called by the button i.e. cmdDeleteingBooking.Click the linq query returns the appropriate value. However when called by cntMnuCancelBookingItem.Click is returns 0 even if a checkbox is of 'TRUE' value. Debugging shows the code runs exactly the same code (which loops around rows in a datagridview checking if the checkbox has been checked). Could someone explain the reasoning why the same code would return different results? Private Sub cmdDelete...

Excel worksheet with VBE codes don't work elsewhere
Hi, Some of my excel worksheets with embedded controls and VBA codes don' work when I open it on another PC. Is there another way to make i work? Thx -- lazybea ----------------------------------------------------------------------- lazybear's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=3519 View this thread: http://www.excelforum.com/showthread.php?threadid=54955 Specifically what problems are you having? Saying "don't work" means absolutely nothing. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC ww...

how to config Server for one user which has 2 mail address.
we have one NT4.0 + Exchange 5.5 Server "A" Email abc@xxx.com.cn ��and another windows2003 + exchange 2003 Server "B" abc@cn.xxx.com user name is same in A B��Mx record was be set ,question is how to config Exchange 2003 to receive down the mail to Server A , because of we need to replace A with B. thanks a lot. E2K3 setup guides you through common scenarios (like yours) pretty much holding your hand - on welcome screen tell it that you have existing E55 org and want to join it, then follow on-screen instructions. Having usable backup of Exchange databases and AD i...

merging 2 cells without losing data?
How can I merge 2 cells without losing data from the other cell? Hi Bob Not possible I'm afraid. Try placing the dat from both cells into one and use "Center across selection" under Format>Cells>Alignment Merge cells always end up causing grief. they are best avoided. ***** Posted via: http://www.ozgrid.com Excel Templates, Training & Add-ins. Free Excel Forum http://www.ozgrid.com/forum ***** "bob" <bobree@hotmail.com> wrote in message news:%23JuOM9HGEHA.2308@tk2msftngp13.phx.gbl... > How can I merge 2 cells without losing data from the other...

Adding a certain text label in a excel chart
I am plotting in regularly basis a certain set of data in excel. Based on some data analysis this set of data has to be fitted to these equations: y = 1/x^a (1) and /or y = b/x^c (2) from data analysis, constants a, b and c are found and are placed lets say in cells A1, B1, C1. On my graph, I am putting then two small text labels where the real equation is displayed: smth. like: y = 1/ x^3.45 and / or y = 0.256 / x^3.12 The whole process is similar with excel curve fitting, when the “show equation on chart” is checked. Thank you in advance My question is: Can ...

Messenger emoticons
I have changed laptops and I did grab the old laptops custom emoticons folder (all in dt2 and id2 file endings.) But when i copy everything in the folder and add it to my new laptops custom emoticons folder... they get added (i.e. show up in the folder) but the images/gifs or names dont show up on the actual msn... *what gives*? Do I have to change the dt2 endings to gif or jpeg and go to "create" in msn for each of them to add them in? (I tried with one and it worked) Only problem is i have alot, like 203 dt2 files so changing the ending to .gif and adding each singu...

Duplicate Containers in AD after Exchange 2003 Migration
The scenario is: We migrated from an NT domain to a 2000 domain. Then about a year later we migrated from exchange 5.5 to exchange 2003. Once the migration was complete, we discovered that there were duplicate containers and OUs in "Active Directory Users and Computers" which were empty. For example, when we did the AD migration we created an OU hierarchy at the root of the domain. After the exchange migration we found a duplicate hierarchy structure under the Users container but it didnt actually contain any objects/information that was in the original OU structure. We don...

Turn off automatic dialing
I recently reloaded Office 97 on my XP computer. Now the computer is automatically dialing into the internet to download email. I only want to dial manually. I've run into this problem before but can not remember how to set it to manual dialing only. Any ideas? Check your mail profile - under the General tab: the default connection state might be online and might be checking for dialup networking. Set this to manual. >-----Original Message----- >I recently reloaded Office 97 on my XP computer. Now the >computer is automatically dialing into the internet to >down...

Adding extra data options
Is there a way to customize CRM to allow for adding another heading? I would like to add a second field similar to topic and would like to call it type. Can you add extra data fileds and types in CRM 3.0? You can add extra data fields to an entity. Go to entities customization at setting area. -- Marco Amoedo Plain Concepts http://geeks.ms/blogs/marco/ "xxdcmast" escribió: > Is there a way to customize CRM to allow for adding another heading? I would > like to add a second field similar to topic and would like to call it type. > > Can you add extra data ...