|
Hi,
I want to change the font of context menu items and it's sub menu items.
How to do it?Should I use owner drawn context menu?If so then can I have any snippet of code for it?
With Regards
Neeraj Sinha
|
|
|
|
|
Neeraj Sinha wrote: How to do it?Should I use owner drawn context menu?
That should work!
See the section "Creating Owner-Drawn Menu Items" here: Using Menus[^]
For possible code samples, maybe CodeProject articles like
How to create owner drawn menus - Step by Step[^]
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
How can I retrieve text from a static text control
that has wrapped the text , I want to get the
text with the line breaks that the control added ,
or I would like to know the number of lines
the wrapped text is printed on . I would also
want to know what text is not displayed because
it has "overflowed" off the viewing area .
Thanks for reading this .
Davey
|
|
|
|
|
I don't see any way to get this info from a static control. The wrapping is probably done
at the time the text is rendered.
You could parse the text yourself and calculate wrap positions using GetTextExtentExPoint()
and render the text youself.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
There are articles on this site that illustrate this technique.
|
|
|
|
|
The DrawText [^] GDI function might be of some help here.
Software Zen: delete this;
|
|
|
|
|
Can any body help me how to store dynamic changes in grammar to cause permanent changes to beutilized every time in future evevn if the application is restarted. I mean how to save the changes dynamically made into rammar.
Regards
Zia
|
|
|
|
|
Hi,
I have to use CTcxMsgBox (http://www.codeproject.com/dialog/tcxmsgbox.asp[^])class in my project with customized background color for MessageBox dialog and buttons on it.
I need to show the message box and buttons in a different color then default color. Is it possible? if yes then plz give some hints.
Best regards,
Cyber Friend.
-- modified at 10:39 Saturday 12th May, 2007
|
|
|
|
|
Does it support with this class if yes you can,whats problem now?
|
|
|
|
|
The same methods you'd use to do this in any window should apply...
For the window itself, you can specify a brush when registering the window class or handle the
WM_ERASEBKGND message and draw the background yourself. To do this, derive a class from the
window class in the article and either register a custom class for the window or add a
WM_ERASEBKGND handler.
For buttons, you'll need to owner-draw them.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hi,
CTcxMsgBox class is derived from CDialog so there is no WM_ERASEBKGND messsage to add the message handler.How to add a different background color for CDialog based class? There is no dialog resource associated for CTcxMsgBox class and it produces the MessageBox using the function
CDialog::InitModalIndirect( (LPCDLGTEMPLATE)_dlgData, m_pParentWnd );
When I put the function
SetDialogBkColor(RGB(206,207,206));
in the CWinApp derived application class's InitInstance() then MessageBox is being shown in new background color but buttons and CRichEditCtrl (which is for text message) are not shown in that color.
Now How to draw the Buttons in different background color?
best regards,
Cyber Friend
|
|
|
|
|
how to find mouse is over on a particular control.
|
|
|
|
|
CPoint point;
GetCursorPos(&point);
CPoint clientPoint = point;
ScreenToClient(&clientPoint);
GetClientRect(&rectClient);
if (rectClient.PtInRect(clientPoint))
{
...
}
|
|
|
|
|
May you can use TrackMouseEvent function and capturing WM_MOUSEHOVER (&WM_MOUSELEAVE).
If u can Dream... U can do it
|
|
|
|
|
Apparently that wasn't an acceptable solution: Click[^]
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Hello !
I'm trying to have a CListCtrl having the same behwvior as in the task manager (when you list the active processes). I set the view to report (to have the different columns). But currently, I can only select a line by clicking on the items in the first column. I would like to be able to click anywhere in the list control and having the line under my cursor to be selected.
Any idea how I can do that ?
Thanks
|
|
|
|
|
|
Thanks, that works fine
|
|
|
|
|
How to declare a CALLBACK function by myself?
And how to make it called?
Can you please help me on this.
KIRAN PINJARLA
|
|
|
|
|
A callback is a function that you define but don't call yourself (thought nothing prevents you to do it). A callback is needed whenever you application has to perform some custom actions on occurrence of particular events. For instance, consider the Windows API EnumWindows (see here ^]), for each found window the OS calls the callback you defined (and as you may notice, you have to conform your callback declaration to EnumWindows requested one).
To summarize, usually:
(1) You have to declare you callback as requested by the callback caller.
(2) You may define your callback as you prefer.
(3) You don't call yourself the callback function.
of course the depicted scenario applies to most of the cases, on the other hand, if you are designing, for instance, a framework, then you have to apply the opposite point of view (i.e. establish the callback declaration, let the user application to define it, call the latter whenver appropriate).
Hope that helps.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Hello....I have this function(printinstance()) who generate me randomly boxes(whith another function) with width,height and depth, and I want to save the results in XML, but it only save me just the last box generated...can you figure out what it is the problem in my code please...I have to do this very quick and I am a beginer in XML.
where f-is the first box generated and l-is the last box generated
void printinstance(item *f, item *l, itype W, itype H, itype D)
{ int p,Wcont,Hcont,Dcont;
int const max=1000;
item *i,*j;
itype x1, y1, z1,x2, y2, z2;
stype vol, totvol;
int notip,po;
Wcont=(int)(W);
Hcont=(int)(H);
Dcont=(int)(D);
for (i=f;i<=l;i++)
{
notip=1;
x1 = i->dx; y1 = i->dy; z1 = i->dz;
for (j=i+1;j<=l;j++)
{
if ((i->dx==j->dx)&&(i->dy==j->dy)&&(i->dz==j->dz)) notip++;
}
p=1;
for (j=f;j<i;j++)
if="" ((j-="">dx==i->dx)&&(j->dy==i->dy)&&(j->dz==i->dz))
{
p=0;
break;
}
if (p)
{
x1=i->dx;
y1=i->dy;
z1=i->dz;
XmlTextWriter^ writer = gcnew XmlTextWriter("d:\\contload.xml",Encoding::UTF8);
writer->Formatting = Formatting::Indented;
writer->Indentation=4;
writer->WriteStartDocument();
writer->WriteStartElement("ContainerSolution");
writer->WriteStartElement("ContainerDimensions");
writer->WriteAttributeString("ContainerWidth",W.ToString());
writer->WriteAttributeString("ContainerHeight",H.ToString());
writer->WriteAttributeString("ContainerDepth",D.ToString());
writer->WriteStartElement("Boxes");
writer->WriteAttributeString("BoxWidth",x1.ToString());
writer->WriteAttributeString("BoxHeight",y1.ToString());
writer->WriteAttributeString("BoxDepth",z1.ToString());
writer->WriteEndElement();
writer->WriteEndElement();
writer->WriteEndElement();
writer->WriteEndDocument();
writer->Close();}}}
and I call my function in the main program like this printinstance(f, l, W, H, D);
lavi
|
|
|
|
|
I tried to look through your code but because of HTML reformatting there's some stuff missing.
This is a short function - can't you step through with the debugger?
If it's only writing the last box then single stepping through one iteration should show you why
it's not writing.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
When post a code use of pre tags and also its better you asking your questionn on the (Managed) C++/CLI [^]
|
|
|
|