Multiline tooltips

I'm handling TTN_NEEDTEXTx messages in my CMainFrame class and copying a
string to the szText member of the TOOLTIPTEXTx structure depending on the
resource id of the control.  I'm doing this because the state for each
control id can change and I want the tooltip to reflect the current state of
the control.  Okay, that all works fine, but how do I implement a multi-line
height tooltip?  I've tried using \r\n and just \n but the tooltips still
are single line with a little box character in place of the carriage return
or line feed.  Anyone know how to do multi-line tooltips and if so, will
this work on all Win platforms?  I'm using Win2K and VS.NET 2003.

Thanks


0
news8666 (15)
10/29/2003 9:48:10 PM
vc.mfc 33608 articles. 0 followers. Follow

2 Replies
290 Views

Similar Articles

[PageSpeed] 33

"Steve" <news@supremebrowser.com-NOSPAM> wrote in message
news:SBWnb.41622$iq3.5910@okepread01...
> I'm handling TTN_NEEDTEXTx messages in my CMainFrame class and copying a
> string to the szText member of the TOOLTIPTEXTx structure depending on the
> resource id of the control.  I'm doing this because the state for each
> control id can change and I want the tooltip to reflect the current state
of
> the control.  Okay, that all works fine, but how do I implement a
multi-line
> height tooltip?  I've tried using \r\n and just \n but the tooltips still
> are single line with a little box character in place of the carriage
return
> or line feed.  Anyone know how to do multi-line tooltips and if so, will
> this work on all Win platforms?  I'm using Win2K and VS.NET 2003.

No promises, but according to the docs it looks as if you need to
SendMessage it a TTM_SETMAXTIPWIDTH. It should work with all platforms for
which version 4.70 and later of the common controls are installed.
-- 
Jeff Partch [VC++ MVP]


0
jeffp (1711)
10/29/2003 10:10:01 PM
Yep, I missed that initially but just tried it and it works as
advertised.... My tooltips are happy happy happy!

"Jeff Partch" <jeffp@mvps.org> wrote in message
news:O0LVnlmnDHA.2200@TK2MSFTNGP12.phx.gbl...
> "Steve" <news@supremebrowser.com-NOSPAM> wrote in message
> news:SBWnb.41622$iq3.5910@okepread01...
> > I'm handling TTN_NEEDTEXTx messages in my CMainFrame class and copying a
> > string to the szText member of the TOOLTIPTEXTx structure depending on
the
> > resource id of the control.  I'm doing this because the state for each
> > control id can change and I want the tooltip to reflect the current
state
> of
> > the control.  Okay, that all works fine, but how do I implement a
> multi-line
> > height tooltip?  I've tried using \r\n and just \n but the tooltips
still
> > are single line with a little box character in place of the carriage
> return
> > or line feed.  Anyone know how to do multi-line tooltips and if so, will
> > this work on all Win platforms?  I'm using Win2K and VS.NET 2003.
>
> No promises, but according to the docs it looks as if you need to
> SendMessage it a TTM_SETMAXTIPWIDTH. It should work with all platforms for
> which version 4.70 and later of the common controls are installed.
> -- 
> Jeff Partch [VC++ MVP]
>
>


0
news8666 (15)
10/30/2003 1:14:18 AM
Reply:

Similar Artilces:

multiline treectrl
Hello, How can I create multiline item of treectrl? Thanks MT Multiline tree ctrls can be done using custom drawing and CTreeCtrl, but are problematic if you allow the user to edit labels, and sometime scrolling is an issue. This might be a good alternative http://www.codeproject.com/treectrl/StaticTreeControl.asp AliR. "mt" <marto@vp.pl> wrote in message news:dqp3t6$ef0$1@nemesis.news.tpi.pl... > Hello, > How can I create multiline item of treectrl? > Thanks > MT Do you mean multiple selections: http://www.codeproject.com/treectrl/MultiSelect_DragImage.asp ...

Edit box
Hi All, I want to create a simple program which has to write in an editbox numbers from 1 to 10, each on a different line. I created an integer member variable and I use a for loop to generate the numbers, but I don't know how to display them on different lines in the editbox. Any help appreciated Regards, Nicolae Just insert "\r\n". -- Jonathan Wood SoftCircuits http://www.softcircuits.com Available for consulting: http://www.softcircuits.com/jwood/resume.htm "Nicolae Fieraru" <nospam@please.com> wrote in message news:41ec500a$1@duster.adelaide.on.ne...

Multiline tooltips
I'm handling TTN_NEEDTEXTx messages in my CMainFrame class and copying a string to the szText member of the TOOLTIPTEXTx structure depending on the resource id of the control. I'm doing this because the state for each control id can change and I want the tooltip to reflect the current state of the control. Okay, that all works fine, but how do I implement a multi-line height tooltip? I've tried using \r\n and just \n but the tooltips still are single line with a little box character in place of the carriage return or line feed. Anyone know how to do multi-line tooltips and if s...

Add a custom tooltip to a file open dialog?
Hello out there, in many file open dialogs when hovering over a file name a tooltip pops up showing information about this particular file. Question: Can I override this tooltip to show specific information which I provide? In my application there will be eventually many (XML) files in a directory and I would like to give the user the option to add a comment when creating a new file AND in the tooltip mentioned above to show this comment. Can this be done? Question 2: Would it be possible to integrate an image into this tooltip (possibly by creating a custom tooltip).? These XML...

CEdit multiline
I read the contents of a file and store them in a CStringArray with each element of the CStringArray containing one line of text. then I use the following routine to display the file contents into a multiline CEdit control, however it display only one line of text Any suggestions will be appreciated. int nLines = m_strFileDataArray.GetUpperBound();; CString temp, temp1; temp.Empty(); for (int i = 0; i != nLines; i++) { temp += m_strFileDataArray[i]; temp = "\r\n"; } m_EditWnd.SetWindowText(temp); /r/n should give a line break. You need to make sure that your control ...

paste multiline text to a single cell-Excel 97
I wrote a little macro to do this with the .GetFromClipboard method and it works fine, but many users will need to do this in the org and I'm wondering if there's a simpler method. Based on other recommendations I tried the replace Alt+0010 method and got an error message that the 'Formula is too long.' Is there a simpler method? Thanks! Cindy Maybe they could just paste into the formula bar. But I don't think I understand the real question. cgbikes wrote: > > I wrote a little macro to do this with the .GetFromClipboard method and it > works fine, but man...

Odd issue with Outlook-hosted webpage tooltips.
Hey all, I've noticed an odd issue with one of our webpages. When viewed in Outlook, the tooltips for images do not work properly (I've tried using both the 'alt' tag and the 'title' tag for the tooltip). I thought it might be an IE security or configuration setting, but tooltips function properly in IE. However, when I browse to the webpage in Outlook, the tooltip no longer functions. This is true with ANY webpage, apparently - not just the one we've created. Has anyone seen this before, and/or know any way to remedy it? Thanks in advance! outlook uses onl...

multiline appointments
I synchronize my outlook calendar with my Palm device. On the Palm I can easily create appointments with multiple lines which show up correctly in various views. These appointments show up with multiple lines after synching to Outlook if I double click on an appointment to bring up the appointment form. But the form shows a maximum of 2 lines at a time. The only way to create a line break in Outlook seems to be to copy the line break from an appointment I created on the Palm and paste it into the Outlook appointment form. However, when trying to print a list of appointments, I can eith...

ToolTip
I'm trying out the TTF_PARSELINKS flag on my tooltip. I get a link that looks fine, but I'm having problems clicking it, because if I move the cursor onto the ToolTip it immediately disappears. Any clues? Bendik Hi, The link feature is implemented only in version 6.00 of the common controls, you simply need to include a manifest and add the flag TTF_PARSELINKS in the toolInfo::uFlags. http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/tooltip/structures/toolinfo.asp http://blogs.msdn.com/oldnewthing/archive/2004/02/25/79842.aspx Hope t...

multiline Static
I have derived a class from CStatic to set the background and foreground colour. I want to make the text multiline. I have tried \n \n\r and variants of in SetWindowText. Is it even possible? Can anyone help? -- Malcolm Clarke "Malcolm Clarke" <not4bad@hotmail.com> wrote in message news:%23ovMI4oSFHA.1152@tk2msftngp13.phx.gbl... > > I have derived a class from CStatic to set the background and foreground > colour. I want to make the text multiline. I have tried \n \n\r and variants > of in SetWindowText. > > Is it even possible? Can anyone help? > &...

multiLine listbox
Hello all I program win32 api in C and I need a multiline listbox, could anyone please tell me how I can accomplish that or refer me to some sample application. Thank you in advance So far as I know all list boxes can hold multiple lines :o) If you mean multiple lines per item then you may need something like: http://www.codeguru.com/Cpp/controls/controls/lists,treesandcombos/article.php/c2291/ Or you could use a list control like: http://www.codeguru.com/Cpp/controls/listview/article.php/c1001/ Tom "Frank" <hero_2030@hotmail.com> wrote in message news:sP6dnVMmG...

Extracting data from multiline Spreadsheet
I have a couple of spreadsheets that use multiple lines for each record. Sample follows: Name Address City State Zip Contact John Citizen 111 Some Streeet Boston MA 00000 jcit@email.com 555-123-4567h 555-987-6543c Jane Doe 222 Another Street Boston MA 00000 555-555-6666h ...

Multiline and DrawText
I want to draw images and text on CScrollView. When I draw text,how do I draw multiline text?I use DrawText,but it draw a line only. pDC->DrawText(pszText, -1, rect, DT_NOPREFIX | DT_NOCLIP); Is your Rect big enough vertically to display multiple lines? Is the text longer than the width in your rect? You use DT_CALCRECT to figure out how big your height should be. If you set the width of the rect to how wide you want the text to be drawn, and then call DrawText with the DT_CALCRECT flag it will adjust the height of the rect to display the entire text, without drawing the te...

Unicode Tooltips
I have a non-Unicode app, but I would like to make my toolbar use Unicode tooltips to get some special characters. I know I probably should have started in Unicode, but this is a legacy application and I don't want to go through it to change all the instances of char* strings to wide strings. Normally, we are supposed to handle the TTN_NEEDTEXT notification message from the Toolbar. But this message is actually one of two messages: TTN_NEEDTEXTA and TTN_NEEDTEXTW, depending on the setting of the Unicode symbol. My app is only getting the TTN_NEEDTEXTA message. How can I create my Tool...

Tooltip for MSFlexGrid Cells
I have a MSFlexGrid control in my application inserted as an activex control. It is non editable. I want to set tooltips for each cell in first row and first column. How could i achieve this? How about a CToolTipCtrl? The following example uses this class in a dialog, but you could use the same principle with a ListCtrl http://www.codeguru.com/Cpp/W-D/dislog/tooltipsfordialogcontrols/article.php/c1843/ M "Ana4raj" <Ana4raj@discussions.microsoft.com> wrote in message news:FD70985B-4046-43E3-B7BB-B0562FE50E1B@microsoft.com... >I have a MSFlexGrid control in my applica...

text in a multiline textbox...
I want to create a string and then pass it into a multiline textbox. In the the string, I will be using \r\n for a newline. I was wondering if there is any way to change part of the string to bold using parameters similar to '\r\n'? Thanks, RABMissouri2006 "RAB" <rabmissouri@yahoo.com> wrote in message news:1155528402.843382.14950@p79g2000cwp.googlegroups.com... >I want to create a string and then pass it into a multiline textbox. > In the the string, I will be using \r\n for a newline. I was wondering > if there is any way to change part of the string ...

Multiline Quote
I am trying to print a quote with multiple line items onto a word template via Word Mail Merge and have all the line items appear on 1 sheet or record. I am using CRM 3.0 and using the print quote for customer feature. I have my template setup, it is type directory, I have used the Alt + F9 to see the hidden code and its all there but it prints each line item as a seperate quote. I see {mergeseq} but that doesnt help me unless someone describes how I can use that to help resolve this. I am not looking to purchase a 3rd party add on unless there is no other resolution. Thanks in advance fo...

CListCtrl multiline cells
I have CListCtrl type report. I need to write into it's items multiline text. When I insert into text "\r\n", it does not help. How to write multiline text into CListCtrl cell ? Other thing what I need is to change font in some cells. I know SetFont(), but how can I retrieve HWND of cell ? Thanks ! Peter You have to create an owner draw control that does that. The only problem with that is that all your rows have to have the same height which could cause problems Here is an example of how to do it: (not so good but at least is a starting point) http://www.codeproject.com/lis...

tooltips disappeared !
I am programming an application based on a skelton created by the assistants of VisualC++.NET (to create an application based on the MFC) Generally, this kind of generation automatically create tooltips. My application is about to be finished and all tooltips have disapeared ! I tried to add them manually (using CBRS_TOOLTIPS... in CMainFrame::OnCreate) and some other actions described in documentations to add tooltips manually, but it doesn't work ! What could interfer ? That should do it. The tooltips are usually the text that is on the correlative menu item (for the ID). ...

Cedit multiline problem
i have a CEDIT control, and multiline is enabled. The problem i have is with a client, all CRLF are displayed as 2 stripes. I can't simulate it. his configurations are: winxp professional service pack 1 font Trebuchet MS 11 Bold does anyone know what the problem could be?? i have tried running my app on more than one xp box, and tried some fonts, but i never have this problem. Maybe there is a known problem with xp ? i don't know thx in advance Does it happen for even something as simple as this? DWORD style = WS_CHILD | WS_BORDER | WS_VISIBLE | ES_LEFT | ES_MULTILINE; edit.C...

Multiline tooltips #2
hi, Is it possible to have multiline tooltips ? thanks, Behzad "behzad Nazari" <behzadvc@yahoo.com> wrote in message news:%23BUIWwptDHA.3468@TK2MSFTNGP11.phx.gbl... > hi, > Is it possible to have multiline tooltips ? > > thanks, > Behzad > > Yes it is. I am not sure as the version specifics, however Baloon tooltips can accomplish this (and iirc so can normal tooltips). Check the MSDN documentation on the CreateToolTipEx function (this may or may not be the correct function, but it is sure to find you the correct one). "behzad Nazari" ...

How to get a UI in a DLL to show tooltips?
I basically need to have an application in a DLL. An application, that we don't have access to the source for, uses a DLL to expand its functionality. Currently we have been displaying only Dialog boxes from the DLL which works fine. We are now adding a new graphics interface that uses the entire CWinApp and Doc/View architecture. When this is created as a DLL some functionality is lost, mainly the buttons on the toolbar don't enable and the tooltips don't work. Then menus work fine though. From what I have gleaned from MSDN and the tech docs the DLL doesn't get...

Tooltip tips
If you try to use tooltip in a VC++7 MFC program like in SuperTip it will not work unless you use the sizeof AFX_OLDTOOLINFO for the tooltip structure: ti.cbSize = sizeof(AFX_OLDTOOLINFO); The definition is found somewhere in the afx.h files. ...

Changing the Tooltip text in an SDI Toolbar
I've been trying to find a way to change the tootip info for a toolbar. Currently, I've tried getting the toolbar CToolBarCtrl and CToolTipCtrl objects but haven't been able to figure out what to do with them. Any help would be appreciated. Thanks, Ken If you are talking about tooltip info of a particular button on a toolbar, change it in resource editor by double clicking on the button and changing the text that appears at the bottom of the dialog. Text that appears before \n is tootip. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "Ken Slight" <kslight@char...

Multiline Edit Control
Dear All, Need Help......... How to restrict Maximum number of Column and Number Of Row in Multiline Edit Control if Number of Charecter in a row Exceed 255 then move to next line But also validate that Line should no exceed 10 But Cursor Position should at the same line and charecter If any Idea then plz Let me know. Lalit You MAY be able to do it by using a fixed font, calculating the size of the edit box needed to contain rows x cols, setting the size of the edit box to this and then using SetLimitText. You have to be pretty careful with this sort of thing as when running on ...