CScrollView and text height

I call DrawText to draw text on the CScrollView.When text has multi-line,how
do I get the screen height to draw them?
Thanks.

___________________________________
http://www.msale.net/bbs
a Chinese-language message board for developers,including
palm,ppc,symbian,and etc.

http://www.zirong.net/blog/
Miken's private life


0
2/15/2005 4:34:36 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
895 Views

Similar Articles

[PageSpeed] 36

If you are trying to calculate the height of a multiline string user
DrawText with the DT_CALCRECT flag.
It will use the width of the Rect that you pass it, and sets the bottom of
the rect to what the bottom would be if you draw it.

AliR.

"Miken" <mikenwonder@msn.com> wrote in message
news:OPl$Aw3EFHA.2052@TK2MSFTNGP09.phx.gbl...
> I call DrawText to draw text on the CScrollView.When text has
multi-line,how
> do I get the screen height to draw them?
> Thanks.
>
> ___________________________________
> http://www.msale.net/bbs
> a Chinese-language message board for developers,including
> palm,ppc,symbian,and etc.
>
> http://www.zirong.net/blog/
> Miken's private life
>
>


0
AliR1 (391)
2/15/2005 6:24:45 PM
Miken,

GetClientRect for the view will get the available height of your output
window.

Johan Rosengren
Abstrakt Mekanik AB

"Miken" <mikenwonder@msn.com> a �crit dans le message de
news:OPl$Aw3EFHA.2052@TK2MSFTNGP09.phx.gbl...
> I call DrawText to draw text on the CScrollView.When text has
multi-line,how
> do I get the screen height to draw them?
> Thanks.
>
> ___________________________________
> http://www.msale.net/bbs
> a Chinese-language message board for developers,including
> palm,ppc,symbian,and etc.
>
> http://www.zirong.net/blog/
> Miken's private life
>
>


0
2/15/2005 6:29:28 PM
Reply:

Similar Artilces:

How to format text in the cell, so the end of text will be visible?
In visual basic: When the textbox is smaller than the text, to display the last part of the text I do: txtWaveFile.SelStart = Len(txtWaveFile.Text) How can I do the same for the particular cell? I have tried: moExcelWS.Cells(1, 2).Text.sellstart = Len(moExcelWS.Cells(1, 2).Text) but that of course is wrong. Jack Maybe you can justify the text to the left? But if there's something in the cell to the left, you won't see the leading text. Jack wrote: > > In visual basic: > When the textbox is smaller than the text, to display the last part of the > text I do: >...

Combo Box Text
In a combo box based on a Table/Query how can I display something like "Plase make a selection" as opposed to the cbo being blank prior to making a selection? Thanks, James On Thu, 24 Dec 2009 06:47:01 -0500, "JamesJ" <jjy@darwin_roadrunne0r.com> wrote: If you're doing Table/Query all the data has to come from a query. So I create a new table (say tblMakeSelection) with one row in it: -1, "Please make a selection" and then I use a union query: select CompanyID, CompanyName from tblCompanies union select ID, Description from tblMak...

Text Values
Hello, Can anybody help, I'm after making a spreadsheet in Excel to record times for individuals, for example if I typed in 'early shift' with the value of 10 hours, after 'noon shift' 8 hours as well as 'late' shift at 12 hours...etc, the total values would all show in a totals cell for that person. I would appreciate any help with the above. Love, Susan Hi Susan see your response in public.Excel -- Regards Frank Kabel Frankfurt, Germany Susan wrote: > Hello, > > Can anybody help, I'm after making a spreadsheet in Excel to record > times ...

popup menu and text length problem
Hi All in my code i am creating a popoup menu in response to a button click. code is like this: void OnBnClickedbutton1() { HMENU hMenu; hMenu= ::CreatePopupMenu(); if(hMenu == NULL) return; for(size_t i = 1; i <= vectorOfString.size(); i++) { ::AppendMenu(hMenu, MF_STRING, i, (LPCTSTR)vectorOfString[i]); } } //here vectorOfString is a collection of string CMenu menu; menu.Attach(hMenu); CRect rect; m_Button1.GetWindowRect(&rect); int userSelection = menu.TrackPopupMenu(TPM_LEFTALIGN | TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RETURNCMD, ...

client connections to exchange full-text index
I've setup a Full-Test Index on our Exchange server and made it available to clients. How do I check that the Outlook clients are using the FTI to perform searches? On Wed, 4 Jan 2006 16:07:26 -0800, MOW <MOW@discussions.microsoft.com> wrote: >I've setup a Full-Test Index on our Exchange server and made it available to >clients. How do I check that the Outlook clients are using the FTI to >perform searches? When your server grinds to a halt. The best way to verify this is to open Perfmon on the Exchange Server and watch the "Queries" and "Resu...

Dates converted into text
I receive Excel data from my branch offices.the data should contain date coloumns.But some cells contain dates in "<year><month.><date>" format i.e.,21/02/2010 in dd/mm/yyyy format is displayed as 20100221.Why it is happening?How to convert them into dd/mm/yyyy format? I tried to record and run a macro to insert "/" between year and month and between month and date,then clicking "Enter" button...But,it displays same date in all the cells in which I run the macro. Try Data>Text to Columns>Next>Next>Column Data Format DMY ...

adding text #2
I am building a work schedule. I have different text and numerical codes for shifts (ob1, ob2, n, sac, 9-5, 1, AND ER) I want the schedule to add only the text I have in parenthesis. I want this to be a numerical value. I want it to ignore my day off code and Holiday Time(do, ht) Also after this I want another cell to show 12- the answer I received from the added days above. I do not want to change the format of my schedule. It has been used for years. I am using Microsoft Excel 2003 98xp pro -- Jay Taylor I'm not clear on what you want. First you say you want the schedule to add on...

Logical tests between Word form text fields
I have a Drop-Down form field with "Yes" and "No". I want to place the value 4 in a Text form field in the same document if the user selects "Yes" in the Drop-Down field. I set the Text form field to type "Calculation" but can not figure out the formula to use that doesn't return a Syntax error or "Undefined Bookmark, Yes". While I have Word 2007, I need to create this form for users with 2003 and so am using Legacy form fields. Hi jstern, Instead of using a calculation formfield, I'd suggest an ordinary formula field,...

Adding Text To Text
Hi all, I have a long list of projects names and I need to add the same tex addition to the lot. Currently the project names are simply displaye as: PROJECT NAME I need to change each entry to: [PROJECT NAME.xls] Can anyone suggest a means of doing this which doesn't involve goin through each and typing the [] and.xls? TIA, Samuel -- Samuel ----------------------------------------------------------------------- SamuelT's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2750 View this thread: http://www.excelforum.com/showthread.php?threadid=48481 If yo...

The text in the inserted text box doesn't print
When I type text into the text box and then print, the added text doesn't show on the printed copy It is possible the added text doesn't fit the text box, have you tried expanding the text box? -- Mary Sauer MSFT MVP http://office.microsoft.com/ http://msauer.mvps.org/ news://msnews.microsoft.com "SS" <SS@discussions.microsoft.com> wrote in message news:8D633F32-E54D-452E-B2F3-427E69BBF8BA@microsoft.com... > When I type text into the text box and then print, the added text doesn't > show on the printed copy ...

Address Book Not Working With Text Messages Sent By Outlook
Every time I try to send a text message per Outlook, I can type and send the message, only as long as I physically type a person's name in the To box. If I click on the little address book button beside the To box or click on the icon at the top of the message page, I immediately get kicked out of Outlook, and it must restart. Does anyone know what is wrong and how it might be fixed? Thanks, Candy What version of Outlook? What type of email account? It sounds like the address book is corrupt. If you use outlook 2003 or older, try this: go to Tools | Email Accounts, choose Vie...

text disapearing in a text box
I put a text box on a chart. After typing it in (it was a long text) I saved the chart I could still see all the text. After I saved it, I created a PDF. It was still fine. After I closed excel. The next time I opened the chart part of the text was gone. I tried to resize the text box, but part of the text was still gone. When I oringinally save the chart I didn't get an error message about the size and the pdf after the save showed all of the text. Thanks ...

email format is changed from HTML to Text
I haven't done any research on this, I hope someone has the answer. Sometimes when I reply to a message, the email format is changed from HTML to Plain text automatically, It does't happen when I am writing a new email, it is just sometimes when I am replying. Are you sure that the message to which you are replying is HTML and not just plain text with foreign encoding? For example, I set the encoding for this message to Turkish, but it is still plain text. It just doesn't appear that way (to me anyway, and possibly also you). Ray at work "Alex Perez" <aperezny@h...

CScrollView in mdi
Hi, I have an MDI app. Sometimes I need to display a scrollview that is bigger than the client area, hence, I want the screen size to fit to the mainframe client area, and to view the rest part of the screen the user will need to scroll (V and H). How do I do it ? 10x, Janiv. If you want to resize the window programmatically, call SetWindowPos. Take a look at the msdn online reference (just type SetWindowPos) for more information. This will allow you to resize the window, now if you want to get the size (height and width) of any window that you have in your application, just call the ...

Text to Columns #2
Having used the "Text to Columns" tool once on a worksheet (to separate by spaces), I find I can't switch it off. Every subsequent time I try to copy and paste some other text from a single cell, for some completely different reason, the pasted data gets spread over many columns if there are any spaces in the text. How can I switch off "Text to Columns" after using it? This surely must be a bug, it's so unreasonable! Tod Excel likes to help by remembering your last settings. This can be really handy if you're pasting similar stuff lots of times. You ...

Help needed
hi all, new to the forums as i need help! running excel 2000 under advanced server 2000 (intel p4 2ghz hp compa evo pc) and having a problem with the text import wizard ; trying to import a fixed column text report with three number column that include negative values in the format 320.06- problem is that they have to be imported as general type as there is n number option in the import wizard which then means that excel appear to treat the negative sign as text pushing the cell justification ove to the left and if i try to create a cell which displays the sum o these three negative values...

Scrolling with CScrollView
Hi everyone, Let me start by saying that I'm rather new to scrolling. I have come accross the following problem. I created a new SDI MFC application that uses CScrollView with Visual Studio .NET 2003. Then I have increased the size in CScrollView::OnInitialUpdate() to 1000 by 1000. Finally I have added the following code in CScrollView::OnDraw(), // TODO: add draw code for native data here CRect rect; GetClientRect (&rect); CString str_scroll; str_scroll.Format(_T(" x = %i y = %i "), GetScrollPosition().x, GetScrollPosition().y); pDC->DrawText(str_scroll, -1, &...

Displayed Row Height Difference For Excel on Mac and PC
Version: 2008 Operating System: Mac OS X 10.6 (Snow Leopard) Processor: Intel Can anyone explain why the displayed row height is different on Excel for Mac compared to Excel for PC? When I open the default worksheet on my Mac, it displays 70 rows on the screen. When I open the default worksheet on my PC, it displays 50 rows on the screen. This occurs using the exact same monitor (Viewsonic 22&quot;) and the exact same screen resolution (1680 x 1050). The default row height on the Mac is 0.18&quot; and the default row height on the PC is 12.75 points (0.177&quot;?). I not...

Text box validation 01-04-08
I have a form with several text boxes that I want to check for duplicate values in the table. The PK inthe table is an Autonumber. What I want to do is not allow the FirstName LastName FileNo and SSN to be the same for any two records. The combination of these fields would garuntee that the same individual would not be allowed to have two records created. You could set a unique index in the underlying table on those four fields. This would disallow the entry of duplicates (but only after the fact -- after the user entered values and tried to save them). Another approach would be to g...

Update Text Box Value
Maybe a simple question Can anyone tell me how I go about updating other text boxes from an input in one text box ?? I have an emloyee number that links to personnel information about an individual .. I would like to enter a pay number in one box ... click a button and their name etc is presented in the other boxes ... Can anyone enlighten me please Many thanks Hi Alan, '----------------------------------- > Maybe a simple question > > Can anyone tell me how I go about updating other text boxes from an input > in > one text box ?? > > I have an emloyee numb...

No text search from File|Open in Excel 2007?
I have recently made the switch from Excel97 to Excel 2007. I use an Excel based purchase order app and routinely had locate and open a saved purchase orders (.xls file) based on a text query. In Excel97 there was the capability to do a text search in the File|Open dialog box. Excel 2007 does not have the text search function. Must I now do text searches outside of Excel or is that capability hidden somewhere? BrianG <decclt@nogmailspamdotcom> wrote in news:800fc$4a3695da$d1a8c432$26391@EDELTACOM.COM: > I have recently made the switch from Excel97 to Excel 2007. I use a...

Using decimals in text?
Here's another question: Is it possible to change a line of text depending on the value contained in a cell? For example, if I have a decimal which is used as an exponent, can I concatenate that value with a units string? Example: value = 0.333, units = "kg" => "kg^0.333" (^ = font superscript) Now change the value to 0.396 and the units label should read "kg^0.396". use ="kg^"&A1 where A1 is the cell containing the decimal exponent. If you want to be able to change the units, use =B1&"^"&A1 where B1 is the cell containi...

Is it possible to shade text within a text box?
I would like to be able to add shading to text within a text box. Is this possible? Thanks for your help. Format, font, select the shadow. The text is shadowed gray, that is the only way you can shadow text unless you use WordArt. -- 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 "Hair Traders" <HairTraders@discussions.microsoft.com> wrote in message news:A452279C-1C69-4235-9520-54D9CB993ADF@microsoft.com... >I would like to be able to add shading to ...

Cannot Export Color Text to PDF
Hi everyone, I'm working in a local chinese magazine company. We have a very serious problem that when we save the publisher file as a postscript (.ps) file and then use adobe distiller to convert it into a .pdf file, we lose all the colors that we had in the publisher file. This happens to both test and picture. If everyone knows what is going on, please reply. Thanks a lot! ^_^ Victor I think I can help you with this, I know a printer driver that converts to many raster, vector and document formats including PDF format, it's called LEADTOOLS ePrint driver and you can try the...

Converting text to Rich Text Format
If I start with a set of text strings where each text string is associated with a LOGFONT and COLORREF (for its foreground color), how do I convert this to Rich Text Format? You have to read about the Rich Text Format syntax. Or a simple way, format the text you want in WordPad and write it out, then look at what got written and replicate it. joe On Thu, 7 Sep 2006 13:30:32 -0500, "Peter Olcott" <NoSpam@SeeScreen.com> wrote: >If I start with a set of text strings where each text string is associated with >a LOGFONT and COLORREF (for its foreground color), ho...