|
I use Draw3DRect because it does the two colour thing in one line. I guess you could derive a class from CStatic that draws a line if you want to define it in the dialog editor and not draw it yourself.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
Sonork ID 100.10002:MeanManOzI live in Bob's HungOut now
|
|
|
|
|
Hello,
I have been reading a bunch of articles here and at codeguru on hiding a column.. but most of the articles I have read people are reporting side effects.. Does anyone know of a good way to hide a column in a list control (report style)? I don't want the user to be able to open the column (yet I want to store data in it).. If I set the column width to 0 it hides it but it can be easly spread open..
Any ideas?
Rob
|
|
|
|
|
If the idea is that you don't want to show a single column, then use
lParam-Parameter of the 'SetItem' function.
If you want to prevent resizing, you have to do the following.
SetColumnWith (ID_COLUMN, 0)
Then override the OnNotity() function to handle the header notification for resizing.
HD_NOTIPY *pHDN = (HD_NOTITY *) lParam
if ((pHDN->hdr.code == HDN_BEGINTRACK) &&
(pHDN->iItem == mID_MY_COLUMN))
{
*pResult = 0;
return TRUE;
}
|
|
|
|
|
Thanks, worked like a charm!!
Rob
|
|
|
|
|
I'm looking for a way to have text over a transparent background, I'm not sure of which MFC approach to take, dialog box or window?
Any ideas on making text "appear" as if hovering over all other apps/windows would help out greatly!
Thanks
|
|
|
|
|
I want to send an WM_ACTIVATE message to a CFormView. (Basically I want the view to know when the App isn't the app with focus anymore.) I have code for the CMainFrame that catches it.
The app is also a SDI app. The only relationship I see is in theApp.InitInstance where it goes:
CSingleDocTemplate* pDocTemplate;
pDocTemplate = new CSingleDocTemplate(
IDR_MAINFRAME,
RUNTIME_CLASS(CGUIDoc),
RUNTIME_CLASS(CMainFrame), // main SDI frame window
RUNTIME_CLASS(CGUIView));
How can get WM_ACTIVATE from CMainFrame to CGUIView?
|
|
|
|
|
MFC already has this built-in, CView::OnActivateFrame()
--Mike--
http://home.inreach.com/mdunn/
While I can't be correct on all matters, I can make the reassuring claim that where I am inaccurate, I am at least definitively inaccurate.
your with and
Sonork - 100.10414 AcidHelm
|
|
|
|
|
|
i have been searching the web for info on enabling and disabling a toolbar button but in vain. how can i enable and disable a toolbar button? pls help. thanks a lot.
(my toolbar is declared as m_wndToolBar, and take for example, 1 of the button is declared as ID_COMMAND_PLAY)
|
|
|
|
|
Add an ON_UPDATE_COMMAND_UI handler for the ID_COMMAND_PLAY command.
void CMyClass::OnUpdatePlay (CCmdUI* pCmdUI)
{
if (playable())
pCmdUI->Enable (TRUE);
} /ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Hi all, I just want to know what the easiest way is to have an edit box (which represents an integer, say width/height) and the arrow buttons, which upon pressing up increments the editbox value by one, and upon pressing down decrements the editbox by one? I have tried mercilessly to do this, but alas I have failed.
Thanks guys,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Use a CSpinButtonCtrl.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Cheers for the response. OK, I see where your going with this, but I`m still unsure as to how to link it to the edit box? I`m using a dialog box to house this control. I have so far placed the edit box and the CSpinButtonCtrl on the dialog. I have created variables for both in the dialog framework (for the CSpin a DDX control is used). Do I still have to "create" the CSpin thingy? or do I link it some other way?
Many Thanks,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Chambers wrote:
or do I link it some other way?
Yes. Ensure that the ids of the controls are consecutive (spin control > edit control), then set the "AutoBuddy" property of the spin control in the resource editor.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
What do I set the "Auto Buddy" too? the ID value of the edit box I presume? If this is right don`t worry about answering it, I`ll delete it if it works now.
Thanks again,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
What I meant was check the "AutoBuddy" property of the spin control in the resource editor. If your ids are consecutive, the spin control will automatically become the buddy of the previous edit control, which causes them to be linked.
Also, you can position an autobuddy spin control anywhere in the dialog - it will be automagically rendered inside the edit control. So remember to account for the extra space when sizing the edit control.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Right, I`ve managed to get them linked, finally. I had to enter the resource editor and swap the order of the ids around because it kept attaching to the save button i had (which is exactly what you said to do Ravi). However, the numbers go UP when i press the DOWN button, and visa versa. How do I swap them around, so that the up button makes the integer go UP, not blinking down?
Cheers for your help getting me this far Ravi,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Yes, that's annoying!
I suppose you could override the spin control's notifications and manually set the edit control to do the opposite.
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
I found an easier way. MSDN help says that, by default, the CSpin thingy's range is set to Min:100 Max , and by clicking the down arrow sends the current value nearer the minimum value, which is why it goes up, its heading for 100. All I did to get it to work properly was call :
CDialog::DoDataExchange(etc.)
{
... min , max
myCSpinThingy.SetRange(0 , 10);
}
and it worked no problem. Just thought I`d let you know, since I wouldn`t have got there in the end if it weren't for you,
Cheers Ravi,
Alan.
"When I left you I was but the learner, now I am the Master" - Darth Vader
|
|
|
|
|
Is there any component to canvert .txt(richeditview)
to htmlview???Or how can I do that?
|
|
|
|
|
I need IIS ,and I search microsoft web site,but I could not find the setup file of it.Does anybody know where can I find it?
|
|
|
|
|
You can go to www.microsoft.com and search for Nt Option Pack.. here is the link but it maybe too long.
http://search.microsoft.com/default.asp?boolean=ALL&nq=NEW&so=RECCNT&ig=01&ig=02&ig=03&ig=04&ig=05&ig=06&ig=07&ig=08&ig=09&ig=10&i=00&i=01&i=02&i=03&i=04&i=05&i=06&i=07&i=08&i=09&qu=nt%20option%20pack&siteid=us
Rob
|
|
|
|
|
Hi all,
im having real trouble trying to use internet explorer automation. I simply want to use the automation to navigate to a page and then print it but i cant even get the object into my project.
What i have tried to do is by using classwizard to add the IWebBrowser2 interface from the shdocvw.dll. However, simply doing this means that my project no longer compiles and gives me the following error:
shdocvw.h(5) : error C2011: 'IWebBrowser2' : 'struct' type redefinition
which then spawns off loads of other errors.
Can someone please tell me what im doing wrong. This is a very simple task that loads of programmers must have done.
Please reply, all replies will be rated favourably as msdn is so full of shite its hard finding the right answers.
Andy.
|
|
|
|
|
Hey
just want to know what is the easiest way to obtain a bitmap( in fact a handle of a bitmap) from a device context of the client zone of a window in which i have already drawn something
Thx for answer
Bye
|
|
|
|
|
get a dc
create a compatible dc (memory dc)
create a compatible bitmap (memory bmp)
select the memory bmp to the memory dc
bitblt from the screen dc to the memory dc
-c
Smaller Animals Software, Inc.
|
|
|
|