I created a tab control with TCS_TOOLTIPS style, hence when mouse is over tab items, it displays a tooltip which shows some information.
The tooltip always has the same x-position as the cursor and below the cursor.
I want to make the y-position of the tooltip exact at the bottom of the tab control. In this case, I need to increase the x-position of the tooltip also, in order to avoid the cursor and the tooltip overlap.
But I can not find any information to adjust the position of a tooltip of a tab control.
Is this related to TTM_TRACKPOSITION flag of TOOLINFO? When I created this tab control, I knows only : get hwnd of tooltip by sending TCM_GETTOOLTIPS message ; Treat WM_NOTIFY message and fill TTN_GETDISPINFO structure to display the tooltip. But I didn't find any information about the position.
Sub-class the tooltip control and modify it's position by catching the WM_WINDOWPOSCHANGING message.
Related
I am using NM_CUSTOMDRAW to draw tree view items. My items right justify parts of it by using a right margin based on the RECT area reported available. The issue I have is that when the vertical scrollbar appears or disappears, only the item expanded/collapsed and the area under the scrollbar seems to update (invalidated regions). This causes the repaint requests (with the new width) to not update the area correctly.
For example (using text and a single space as example): You could have something with the scrollbar be right justified text ## where ## is the scrollbar then when the scrollbar goes away you end up with right justified text t instead of right justified text
Is there a good way to fix this?
One thought is if I could catch a message when a scrollbar shows up or goes away, I could just invalidate the window to force a redraw. Is there such a message?
Or is there a way to add to the invalidated region without triggering a redraw loop but would update the full items area?
Another thought is I can just use the full window RECT size and use a right margin large enough that wouldn't be under the scroll area but I'd rather not do that.
Thanks!
Is there a way to have a button with text and graphic, with the graphic on the right side of the text, without having to owner-draw the button?
I want to just sent BM_SETIMAGE and whatever else would be needed so the graphic is to the right of the text.
Also, I noticed the image is so tight against the text that it doesn't look good. Is there a way to adjust the margin without having to use a blank space in the text?
Is there a way to have a button with text and graphic, with the graphic on the right side of the text, without having to owner-draw the button?
There are BS_LEFTTEXT and BS_RIGHTBUTTON styles available, but the documentation says they only apply to CheckBoxes and RadioButtons:
Constant
Description
BS_LEFTTEXT
Places text on the left side of the radio button or check box when combined with a radio button or check box style. Same as the BS_RIGHTBUTTON style.
BS_RIGHTBUTTON
Positions a radio button's circle or a check box's square on the right side of the button rectangle. Same as the BS_LEFTTEXT style.
For a standard push button, there does not appear to be a way to control the position of the image other than through owner-drawing.
Is there a way to adjust the margin without having to use a blank space in the text?
Use BCM_SETTEXTMARGIN/Button_SetTextMargin():
Sets the margins for drawing text in a button control.
I would like to display tooltip when hover a link
But sometimes the text of label of node got in the way--> no longer the mouse focus in hovering link.
Is there any way to completely ignore the label and let the link hovering happens as expected? Just like the label is not there (still display) anymore
I have a data table, and on one of the columns, i have tooltip for specific information about the specific rows, now i am trying to place a link inside the tooltip, and that should be clickable (which should navigate to another page),
so here i am unable to click the link inside the tooltip, because when we try to move mouse inside tooltip the tooltip also moving,
and i want the tooltip to be displayed on mouseover as usual and also when i click a specific row that tooltip should stay there and it should allow me to click that link.
can some one help me out for this?
You should set the followMouse attribute to false
I have an MFC app that embeds a Scintilla text edit control. I want to customize the Scintilla control to display some custom controls next to the vertical scrollbar. Essentially, I want to render some controls in the orange area below, where the green area represent the scroll bars:
I tried overriding the WM_NCCALCSIZE message of the Scintilla window and subtracting an offset from the right side of the client rectangle. Here is the code:
void CScintillaCtrl::OnNcCalcSize(BOOL bCalcValidRects, NCCALCSIZE_PARAMS* lpncsp)
{
CWnd::OnNcCalcSize(bCalcValidRects, lpncsp);
lpncsp->rgrc[0].right -= 100;
}
However, this causes the vertical and horizontal scroll bars to reposition themselves to account for the smaller client width, as shown below:
I'm not sure if this behavior is caused by Scintilla or Windows. Is there a way I can adjust the client area and preserve the positions of the scroll bars?
I found a Scintilla specific solution. I can use the SCI_SETMARGINRIGHT command to add a margin to the right side of the client area, and then render my controls inside that.