|
You could do this by catching the messages WM_HSCROLL and WM_VSCROLL
<code>
void CMyView::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
InvalidateRect(NULL);
<CBaseView>::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CMyView::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
InvalidateRect(NULL);
<CBaseView>::OnVScroll(nSBCode, nPos, pScrollBar);
}
Replace CBaseView by the name of the base class view you use (CHtlmView I presume)
This code will ensure all the window will be marked as to be redrawn.
Hope this work
K.
The great error of nearly all studies of war has been to consider war as an episode in foreign policies, when it is an act of interior politics - Simone Weil
Fold with us! ¤ flickr
|
|
|
|
|
Thanks again.
I tried your code, but still there's a white remnant when I click the scroll bar. I just delete the '::' from OnVScroll and OnHScroll in order not to catch an error upon compiling. .
Ok, I get a handle for WM_HSCROLL and WM_VSCROLL in PreTranslateMessage(MSG* pMsg). I don't know what attributes will I put in OnVScroll(..) and OnHScroll(..).
With great power comes a great responsibility.
-- modified at 11:04 Friday 7th October, 2005
|
|
|
|
|
Ok, as you suggested using InvalidateRect(NULL) and as I read from microsoft's site, here's what I did on my project.
At my CMyProjectView.cpp, I made this.
void CMyProjectView.cpp::OnUpdate()
{
InvalidateRect(NULL);
return;
}
but nothing's happened when I run again my project.
With great power comes a great responsibility.
|
|
|
|
|
Hello again people ::- ). My troubles with the MFC radio buttons aren't over. Even though I think I did everything right, something still doesn't work. I put 5 radio buttons and selected the "GROUP" flag only for one of them, as this should be done. Then, to that one radio button, I mapped an m_iSelected member variable using the Class Wizard. The Class Wizard naturally initializes this to -1 and as far as I understood, when the user selects another radio button, in this m_iSelected there should be the index of the selected radio button. If I select the 3rd radio, its value should be 2. Well, it's still -1 no matter what I do. Any idea what's the problem? Thanks ::- ).
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Well, this behaviour is by design.
When you use ClassWizard to add such a variable you let the value of the variable to be updated when DoDataExchange is called. Call UpdateData and m_iSelected is updated since the framework will call DoDataExchange for you.
Perhaps you want to use ON_COMMAND_RANGE instead to have a message handler to be called when you click one of the radio buttons and update your variable in the message handler not using DDX.
Hope this helps
--
Roger
|
|
|
|
|
Of course it shows unchanged
Make a call to UpdateData(TRUE)
before useng the value of m_iSelected.
SkyWalker
|
|
|
|
|
Thanks Roger Stoltz & Mircea Puiu. It works now. Hooray.
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hi everybody, this is the first time Im posting on these boards. I've gotten allot of good information here so I thought Id ask here first.
Im currently hooking into the SHELLDLL_Defview thread of the Program Manager. The hook is of type WH_CALLWNDPROC. Once my callback function kicks in, I use it to call SetWindowLong to replace the Windows process. Everything is fine up till this point. The problem I have is when I try to unhook. Before I extract the hook, I make another call to SetWindowLong to replace the origional Window process. Ive checked the values of my parameters before the call and they are good. I end up getting a ERROR_ACCESS_DENIED. Now, I know that the call in the CallWndProc procedure works fine. Why is it only when I go to put the stuff back that I get the error?
|
|
|
|
|
I have a dialog box with an Editbox.
I just want to have an Static text int he dialog box which will display number of characters present in the Editbox
Thanks a lot for your time and help.
|
|
|
|
|
CString str = "";
((CEdit*)GetDlgItem(IDC_MY_EDIT))->GetWindowText(str);
str.Format("%d", str.GetLength());
((CStatic*)GetDlgItem(IDC_My_STATIC))->SetWindowText(str);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
What you can do is set the text of your static control whenever something changes in the EditBox. Here how to do that:
1) Go to class wizzard and add a handler function for the 'change text' message (I don't remember which message exactly.
2) In this handler function Retrieve the text of your EditBox (GetWindowText) and calculate his length (with strlen).
3) Format this value in a new string (with sprintf) and set the text of the static control (SetWindowText)
|
|
|
|
|
cedric moonen wrote:
What you can do is set the text of your static control whenever something changes in the EditBox. Here how to do that:
Ohh I miss DeadLine
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Handle the EN_CHANGE message on Edit Box :- here is handller and IDC_EDIT1 is ID of Edit Box and IDC_STATIC_TEST is ID of the static box.
void CNegCtrlDlg::OnChangeEdit1()
{
CString str;
this->GetDlgItemText(IDC_EDIT1,str);
SetDlgItemInt(IDC_STATIC_TEXT,str.GetLength());
}
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to create a control like "timer control"
which in design veie won't change its size and in running mode invisible.
how can I proceed.
May be I am asking a silly quistion. But I am new to ActiveX control.
So please help me.
Regards
Anil
|
|
|
|
|
Hi All,
i am developing an applicarion in which a user can select any drawing entity and can translate it to any positin he wants..
I am using meta files for doing this..
i know how to translate it on the context..
but can anyone suggest me any method or procedure with which i can rotate it??
Can u suggest any link to page which illustrate this??
Ashwin
|
|
|
|
|
1. How can I create a Vxd(virtual device driver)?
2. Can you tell the steps in easy ways?
3. I heard that for creating a Vxd we must create certain
files with extension .sys.
4. Can i create a Vxd by simply specifying the EXE-Type
option of the linker as VxD?
5. Is the coding differs from normal VC++ coding?
|
|
|
|
|
Virtual device drivers only work in Windows 95, 98, and ME. You will need a copy of the Driver Development Kit (DDK) for Windows 95/98/ME, which may be difficult to find.
Software Zen: delete this;
|
|
|
|
|
Hi all..
I want to store Tree Information(CTreeCtrl), can any one help me out...
|
|
|
|
|
|
swarnamanoo wrote:
I want to store Tree Information(CTreeCtrl), can any one help me out...
Use STL::Map or Vector to store information if you required it at runtime only.. other wise you want to save it as file.. then XML format is best format for storing tree like information
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
I want to make cut and paste operations on the CTreeCtrl...And i do not want to use clipboard instead wanted to store the tree information in a class...i want to use STL but iam not clear of how to go about..
|
|
|
|
|
Plz suggest a good tutorial on using Log/Semi Log Scales from VisualC point of view..
-- modified at 0:52 Friday 7th October, 2005
|
|
|
|
|
In VC 6, using the Class View to add functions and variables was quick and painless.
After moving the project to 2003 .net I mostly get
"An error has occured in the script on this page.
...
Error: 'arr_ControlTpyes' is null and not an object.
Code: 0
I have this after a clean install from the MSDN disks on multiple systems.
Has anybody run into this, how do I fix it?
Meanwhile, I use the manual method, but it's a step backwards...
-- Harald
|
|
|
|
|
I have a short question, and if the answer is no, then I have a much longer question I'll reply to this message with.
Can I only invalidate one rectangle specified by a couple CRect structures at a time? For instance, if a thread in a single timeslice had to run this code:
CWnd * pParent = ::AfxGetMainWnd();<br />
pParent->InvalidateRect(rect1, true);<br />
pParent->InvalidateRect(rect2, true);
where: rect1 and rect2 are pointers to valid CRect structures
I read in the help documentation, that that rectange is added to some list of regions to be updated so I think the answer is no but I can't find any information to definitively say yes or no, so hopefully some kind soul will ease my quarreling thoughts.
|
|
|
|
|
LighthouseJ wrote:
Can I only invalidate one rectangle specified by a couple CRect structures at a time?
yes I believe!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|