CStatic derived dialog and auto-resize

Hi,

I would like to add auto-resizing feature to my Cstatic derived control. I 
mean when I load a bitmap I would like to adjust size
dynamically.
I tried to SendMessage WM_SIZE but it doesn't work.


0
biproc2004 (43)
1/11/2005 6:18:02 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
691 Views

Similar Articles

[PageSpeed] 40

>I would like to add auto-resizing feature to my Cstatic derived control. I 
>mean when I load a bitmap I would like to adjust size
>dynamically.
>I tried to SendMessage WM_SIZE but it doesn't work.

You can resize a window by using the SetWindowPos or MoveWindow APIs.

Dave
-- 
MVP VC++ FAQ: http://www.mvps.org/vcfaq
0
davidl7375 (2060)
1/11/2005 6:35:47 PM
Reply:

Similar Artilces:

Rate per hour and auto calculation
Sorry, I don't know a lot about Excel. Can you please tell me how I can put rate per hour, so when I put number of hours in "Time" column the program will give me auto calculation in "Amount" column? Thanx a lot in advance. A2: 25 (rate per hour) B2: 4 (hours) C2: =A2*B2 (amount) HTH Jason Atlanta, GA >-----Original Message----- >Sorry, I don't know a lot about Excel. >Can you please tell me how I can put rate per hour, so when I put number of hours in "Time" column the program will give me auto calculation in "Amount&...

CListCtrl in Help About Dialog Box
Hi. I’ve used a CListCtrl before in my FormView, but I haven’t used it in a Help About dialog before and I’m having trouble. MyApp.cpp has code something like this: Void CMyApp::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.m_myListCtrl.InsertColumn(0, “Name”, LVCFMT_LEFT); } I get the assert in the call to InsertColumn(). It’s in the return statement in InsertColumn() where the assert occurs (in afxcmn.inl). Any idea? Thanks. That's because the list control hasn't been created yet (because the dialog box hasn't been created yet). So you have 2 choices. One is to ...

flickering free and transparent CStatic
Hi, I am currently trying to write a very simple CStatic derived control. It has to be flicker free and transparent. I mean by transparent that if there is a bitmap under the Cstatic we will see it. I have achieved to do a transparent CStatic but that flickers and one flicker free but not transparent. The problem is I am using the CMemDC (by Keith Rule available on code project) but as someone said the class is assuming the background is Opaque by filling in the background of the DC.(FillSolidRect(m_rect, pDC->GetBkColor());) But it should check the BK mode instead and do somethin...

AUTO DATE RECOGNITION
HOW CAN I STOP PART NUMBERS WHICH HAVE DASHES IN THEM BEING CONVERTED INTO DATES WHEN I DO A DATA IMPORT INTO EXCEL? Yell real LOUD. That does it for me. Seriously, please don't use all caps for subject or body of msg. It is considered shouting and rude. Try pre-formatting your destination range to text. -- Don Guillett SalesAid Software donaldb@281.com "TONY" <anonymous@discussions.microsoft.com> wrote in message news:AD32B08C-CD73-4585-B706-6F29B17894D0@microsoft.com... > HOW CAN I STOP PART NUMBERS WHICH HAVE DASHES IN THEM BEING CONVERTED INTO DATES WHEN I DO A ...

Any way to disable to auto copying?
Version: 2004 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel I like the lower right corner drag/ copy feature of excel. It's actually one of Excel's best features. <br> Recently I noticed, Excel will fill in every cell below of the workbook in one shot - weather I ask it to or not. So then I have to command Z and then do the drag for the 5 cells below, I wanted to drag/copy. <br> Any way to disable this force-fed feature? thanks! Hi Kevs: Sorry, you're going to have to describe what you have, and what you want, more precisely. I can't...

How to Auto- Empty Deleted Items
How to Auto- Empty Deleted Items when users log off. Is there a global setting or something instead of doing it on each users profile? >-----Original Message----- >How to Auto- Empty Deleted Items when users log off. > >Is there a global setting or something instead of doing it on each users >profile? > > >. > I know of no way to do that. Besides, that should be at each users discretion. "Chuck Davis" wrote: > > >-----Original Message----- > >How to Auto- Empty Deleted Items when users log off. > > > >Is there a globa...

Deriving from CString...?
Hi all, I writing a class that derives from CString and adds a few more pieces of frequently required functionality; e.g. a constructor that accepts an int a formats the CString appropriately, a Split() function that returns a CStringArray of tokens based on a separator etc. Of course, the main requirement for my class is that it can be used anywhere a CString can be used. Problem is that I've run into a situation where it doesn't. e.g. CString str1(_T("CString")); CMyString str2(_T("CMyString")); TRACE(_T("%s; %s\n"), str1, str2); produces the follow...

Working with CStatic!
Hello, I have a dialog based application and i have 4 square "frames" symetrically filling the client area of the main dialog box . Each frame is meant to receive picture from a camera. I have added 4 CStatic member objects to the dialog class to be able to dynamically act on the frames. My objecs are : CStatic m_frame1,m_frame_2 ,m_frame3, m_frame4; The ressource IDs are appropriately connected to the respectives CStatics objecs DDX_Control(pDX, IDC_STATIC1, m_frame1); and so one.... I want to dynamically control the postions of the frame. so i did: CRect rect , temp_rect; ...

Auto spell correction
Pretty basic...But I can't work it out. I have a table that just has a list of acronyms and then the description next to them. One acronym is 'CNA' = Customer not available However access keeps changing it to 'CAN' I've looked everywhere to turn this off, but cant find owt. I wouldnt mind but it is bound to a external report generated by another company and they wont change the acronym! Any pointers? Sorted, found the Auto correect menu and deleted CNA from the list. "Steve B" <meinthecorner@gmail.com> wrote in message news:CEB28289-2C77-42...

Format cells dialog
I have a xls file that will not let me do any cell formatting to some cells. I can use the format painter to force changes. The sheet is not protected. I have the same problem whether it is marked locked or not. When I select Format | Format Cells.. , right click the cell and select "Format Cells..", CTRL+1, nothing happens. I can use the Alignment buttons but will never get the Format Cells Dialog Box. Other cells on the same sheet work just fine? I'm using 2007 You say that some cells work OK. Copy those that do work to those that do not and I think...

How can I create subitem in my own CStatic?
Hello,All! I have wroten a programme which is a sub-class of CStatic, and I used the CDialog to create a CStatic,then I replaced it by my own sub-class, However,when I try to create an item in my sub-class in its member function which was called "afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);",this function wouldn't be called. is there anybody who can tell me how I can create an item in my own-subclass? Thanks in advance! OnCreate will get called when the item is created dynamically using the Create method. If you are using DDX_Control to attach the variable to the con...

insert jpg onto dialog box
How do you insert a jpg picture from file on to an area of a dialog box I can do this using picturebox to insert a jpg picture onto a form, but the picturebox control is not available for a dialog box Thanks -- Patrick Hello patrick, > How do you insert a jpg picture from file on to an area of a dialog > box > > I can do this using picturebox to insert a jpg picture onto a form, > but the picturebox control is not available for a dialog box > GDI+ would be the way to go to do this. Another option, is described here: http://msdn.microsoft.com/msdnmag/issues/01/10/c...

Changing dialog's sahpe at runtime
Hi everyone,I am a newbie to MFC so help would be greatly appreciated I want to create a dialog and at runtime i want to change its shape.Lets say if i click any button on it its shape should change (to circular or anything i want) with all the controls properly placed Can anybody please tell how to achieve it?? Thanking you in anticipation Regards Tauseef ...

how we can resize labels
hi , How ,we can have labels which can resize as our form window minimize or maximize. Arbind You can use SetWindowPos to change any window. You would typically do this in OnSize handler of your dialog. Take a look at codeguru for some code which shows how to do this if controls are anchored in a dialog. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Arbind" <arbindb_tech@rediffmail.com> wrote in message news:OlNKhy7iDHA.2616@TK2MSFTNGP10.phx.gbl... > hi , > > How ,we can have labels which can resize as our form > window minimize or maximize. >...

zoom bitmap in CStatic Picture Control
Hello NG, I show an image with SetBitmap of my CStatic Picture Control in a dialog. My CStatic window's size is unsizable, so I let the image be shown centred. But each image is dimensioned differently. How can I zoom the image in my CStatic? CRect rect; m_stcPic.GetWindowRect(rect); // mein CStatic Picture Control double fx = (double)image.GetWidth() / (double)rect.Width(); double fy = (double)image.GetHeight() / (double)rect.Height(); HBITMAP m_bitmap = image.MakeBitmap(); if (fx > fy) { // use fx to zoom } else { // use fy to zoom } m_stcPic.SetBitmap(m_bitmap); In ...

Can I resize a project in Publisher to fit a smaller page?
I have a finished project for 11 x 14 paper and would like the same layout to fit smaller paper. Can this be done without going back and resizing every item on the page? I have Publisher 2000 -- ruthie41 Save as a PDF, print to a smaller size. http://www.primopdf.com/ -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com http://officebeta.iponet.net/en-us/publisher/FX100649111033.aspx "ruthie41" <ruthie41@discussions.microsoft.com> wrote in message news:BB9C9238-A912-4D0B-A188-CCF61A36AAA4@microsoft.com... >I have a...

copy dialogs between projects
I have a test project which contains a form which I now want to incorporate into my application. I know how to copy the dialogs class and supporting classes as they are just text files. How do I copy a dialog (within an RC file) to a different project. Thanks Malcolm Clarke I forgot to say I am using Microsoft Visual Studio .NET 2003 ta "Malcolm Clarke" <not4bad@hotmail.com> wrote in message news:u9sIzPCSFHA.2932@TK2MSFTNGP09.phx.gbl... > > I have a test project which contains a form which I now want to incorporate > into my application. I know how to copy the ...

CStatic
I have a CStatic in a dialog box which contains a graphic. I want to be able to clear what's in the CStatic if the user clicks a button. How do I set the CStatic to show nothing. I don't want to set it to null because I don't want to get rid of it. You can always do nothing in OnPaint except clearing the dc but an easier way would be to simply hide the control. Subclass it and then use ShowWindow to hide/show it. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "William Gower" <w_gower@hotmail.com> wrote in message news:e8b6g8jhDHA.2504@TK2MSFTNGP09.phx.gbl.....

auto run a macro
Hello, I wanted to create a macro to generate a unique number that can be used as a "qute number". My spreadsheet has a "now function" in it. My macro coverts this function to a number format with four decimal points. So everytime I open the spreadsheet it generates a new number. I want the macro to work in the quote spreadsheet but be disabled once the file has been saved to a new name. I thought this would happen if I saved the macro in the "this workbook" but when I save the file to a new name then close all workbooks and open the save...

Macro Dialog Box Drop Down Options
I was just posed a question regarding the drop-down list in the Macro Dialog Box. Apparently, a previous user customized this list to include his own macros. I'm refering to the "Macros In" drop down box you get when selecting "Tools", "Macro", then "Macros" in Excel 2003. Anyhow, this person wants to know how to have the same thing happen on her laptop as happens on her "inherited" desktop and have this database of macros available from the drop down menu. Does anyone out there have any clue how this is done? EC The macros could be i...

CStatic cs1; CStatic *cs1=new CStatic; What's the difference?
What is the difference between the following 2 declarations? CStatic cs1; CStatic *cs1=new CStatic; Why does this work: CStatic *cs1=new CStatic; cs1->Create("Hello there",WS_CHILD|WS_VISIBLE,CRect(1,1,200,20),this); and this not work: ? CStatic cs1; cs1.Create("Hello there",WS_CHILD|WS_VISIBLE,CRect(1,1,200,20),this); I am also wondering about the 5th argument of CStatic::Create. It's the control ID. What rules should I apply to assigning one? (How do I make sure it's unique?) When does it get used? "Yasoo" <anonymous@discussions.micros...

Changing current directory(folder), using dialog window (MFC app).
We can change directory with the help of the following code: CFileDialog m_ldFile(TRUE); m_ldFile.m_ofn.lpstrInitialDir="c:\\"; // the initial folder. //below the dialog window is opened, then tfolders and eventually a file and after automatically current directory is changed . if(m_ldFile.DoModal()==IDOK) { //below finding out the path. m_strPath=m_ldFile.GetPathName(); UpdateData(FALSE); } We don't need to open a file, but only a folder, in order to change current directory. Could you explain please, how I can change current directory without opening file. Alur....

Hang you can simulate with ATL composite control, MFC dialog and Radio buttons
Hello, I am facing a very wierd problem. I have an ATL composite control and am trying to host it on an MFC dialog. When a radio button on the MFC dialog is clicked, the application hangs. In Visual Studio.NET 2003, when testing the dialog, if you click the radio button, Visual Studio hangs. I tried searching for this problem on the forums but could not find anything. Here are steps to reproduce the problem (I have checked this on a Windows 2000 PC): a) Build an ATL composite control with a single edit box (or any other control) in the dialog box. Make sure that the project is *not* attribu...

Allow developer to extend auto-numbering
Is there a way to extend the Auto-numbering screen to include tables other then Contracts, Cases, Articles, Quotes, Orders, Invoices? Specifically we wish to add an auto-generated id for leads / opportunities without using a post-callout. If a seperate table (rather than fields in OrganizationBase) held the auto-numbering details it would be easy to extend & would also help with scalability - currently every Contract, Case, Article, Quote, Order & Invoice has to lock the OrganizationBase record. There is no supported way to do this. Matt Parks MVP - Microsoft CRM ----------...

How tocreate child Dialog window in MFC Dialog based application
Hi I m having a problem with creating child window in MFC Dialog based application I have tried several things like createwindow() but it works for child ciontrol class like EDIT but it does not work for CDialog what should I do? I m new to MFC programming Hi, Just browse through the styles tab in the properties of the dlg. Select child. Borders to none.Create the dialog dynamically and Give the last argument of the create fun as this telling this created dialog is child of parent dialog. thanx urpavan@gmail.com I have used the following link to get rid of this problem http://www.dee...