|
Can you be more specific on what you really want to do, if you want to avoid Subclassing. What's your need?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
what i wanted to explain is that i have got a dialog which has 6 edit controls. all controls need subclassing, so can i make one subclass and use it for all the controls.
"Men never do evil so completely and cheerfully as when they do it from religious conviction"
-Pascal
|
|
|
|
|
I got that from your very first post that you need to subclass the controls on your dialog. Can you be specific on what type of controls are you having on the dialog that need to be subclassed and for what?
If you want to process some messages to the control's you can subclass the edit control for once.
Say create a class called CXEdit derived from CEdit and then make the control variables for edit boxes of type CXEdit
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
-- modified at 7:05 Tuesday 20th June, 2006
|
|
|
|
|
they are all edit boxes and i need to restrict the alphabets and numbers in edit box .i cant use the PreTranslateMessage since i need to enable a listbox when i press the key .if i use subclasses it will take 6 subclasses .so can i use global subclassing and how to implement it.
"Men never do evil so completely and cheerfully as when they do it from religious conviction"
-Pascal
|
|
|
|
|
Just derive the one class from CEdit and use that class for all the controls of type CEdit ..
class CEditEx:public CEdit<br />
{<br />
add extra methods or override the methods of the control.<br />
}
use the class as how we use Normal variables.
CEditEx m_Name,m_Goal;
Knock out 't' from can't,
You can if you think you can
-- modified at 7:07 Tuesday 20th June, 2006
|
|
|
|
|
how to enter star (*) for every word that is type in the edit box for password
thanx
prashant jain
|
|
|
|
|
use CEdit::SetPasswordChar(...) for setting the password's masked char
|
|
|
|
|
Hi,
See CEdit::SetPasswordChar(TCHAR ch) to set the password for Edit Box.
Add a control variableto Edit-Box let m_edit.
Add following statement in your code
m_edit.SetPasswordChar('*');
Best Regards,
Aniket
|
|
|
|
|
thanx its working
prashant jain malviya national institute of technology
|
|
|
|
|
Right Click on the Edit control and Select Properties and tehre you can set the Password = true in VS2003 and in VS 6.0 check the Password property from Styles Tab.
Cheers
"Peace of mind through Technology"
|
|
|
|
|
thanx
prashant jain malviya national institute of technology
|
|
|
|
|
plz solve my problem
as i change the color of static control but as it contain text so under
text it does not change color i use folloowing code to change color
HBRUSH CAdmin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
{
if(nCtlColor== CTLCOLOR_STATIC )
hbr=CreateSolidBrush(RGB(0,100,0));
}
return hbr;
}
Please mail me
|
|
|
|
|
|
it will transparent all dialog box
Please mail me
|
|
|
|
|
I didnt sea any problems with you code.
yogendra kaushik wrote: as i change the color of static control but as it contain text so under
text it does not change color i use folloowing code to change color
I didnt get you actually
can you be more specific?
SaRath.
"Do Next Thing..."
Understanding State Pattern in C++
|
|
|
|
|
Maybe you should try this?
HBRUSH CAdmin::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr;
if(nCtlColor == CTLCOLOR_STATIC )
{
hbr=CreateSolidBrush(RGB(0,100,0));
pDC->SetBkColor(RGB(0,100,0));
}
else
{
hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
}
return hbr;
}
|
|
|
|
|
thank s a lot .................again
Please mail me
|
|
|
|
|
Hi to all,
How to impleament Drag-Drop event between 2 different Tree Controls OR within same Tree Control?
Plz, give me simple idea or simple code.
Best Regards & Thanks,
Aniket Salunkhe
|
|
|
|
|
|
Thanks for ur suggestion.
|
|
|
|
|
how do i code in visual c++ for searching a string in a file or any document
sriv
|
|
|
|
|
|
sriv_18 wrote:
how do i code in visual c++ for searching a string in a file or any document
are you u reading file in Soem String or you directly want to run find algorithm in file?
"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
Support CRY- Child Relief and You
|
|
|
|
|
Do you need to search in files(search in txt file like notepad)
whitesky
|
|
|
|
|
Many times I have to maintain the existing code.
So how to understand in visual studio if the given code is MFC dll or win32dll
or if the given executable had other dlls statically linked or dynamically linked?
row
|
|
|
|