|
-
March 31st, 1999, 06:10 AM
#1
changing activex control style
I have created an activeX control subclassing an edit control. I have a property page where i will ask for the alignment of the text such as Left, Centered or Right. I dont know how to change the style of the edit control. Also I need Auto HScroll and Auto VScroll properties in the same edit control. If anybody knows it please do reply at the earnest possibility. Because this is delaying the release of our product. Thank you in advance.
-
March 31st, 1999, 08:39 AM
#2
Re: changing activex control style
The code bellow is a part from a COleControl-derived class which implements
a subclassed editcontrol. This control has a property with the name
"BorderStyle". The associated member variable is m_border. I hope this
code example helps you.
Dieter
The member m_border has the following values:
enum {
Border_None = 0,
Border_Flat = 1,
Border_ClientEdge = 2,
};
BOOL CRegexeditCtrl::PreCreateWindow(CREATESTRUCT& cs)
{
cs.lpszClass = _T("EDIT" ;
cs.style |= ES_AUTOHSCROLL;
cs.style &= ~WS_BORDER;
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
if (m_border == Border_Flat)
cs.style |= WS_BORDER;
if (m_border == Border_ClientEdge)
cs.dwExStyle |= WS_EX_CLIENTEDGE;
return COleControl::PreCreateWindow(cs);
}
CRegexeditCtrl::CRegexeditCtrl()
{
InitializeIIDs(&IID_DRegexedit, &IID_DRegexeditEvents);
m_border = Border_ClientEdge;
...
}
void CRegexeditCtrl: oPropExchange(CPropExchange* pPX)
{
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));
COleControl: oPropExchange(pPX);
// TODO: Call PX_ functions for each persistent custom property.
PX_Long(pPX,_T("Border" ,m_border,Border_ClientEdge);
...
}
void CRegexeditCtrl::OnResetState()
{
COleControl::OnResetState(); // Resets defaults found in DoPropExchange
// TODO: Reset any other control state here.
m_border = Border_ClientEdge;
}
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|