|
In C#, it is possible to create a new form based on an existing one. C# calls this an "inherited" form and allows you to use the controls and functionality already set from another form.
In C++, aside from manually making the dialog in code using dialog templates, is there any simpler way to do this?
|
|
|
|
|
unfortunately there aren't any easy ways to inherite forms (dialogs).
just copy the previous resource and work on it....
hope this helps
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
>Ask not what your application can do for you,
>Ask what you can do for your application
haha. i guess creating the dialog box from code is the way to go.
|
|
|
|
|
I use ShowWindow(SW_SHOWMAXIMIZED) to make window max, and drag its border frame to change its size, then click button to ShowWindow(SW_SHOWMAXIMIZED) ,but it does not work,what's the problem?
|
|
|
|
|
Hi chybin,
whats your problem?
Do you need to maximized window?
|
|
|
|
|
the window has been maximinized, I drag its border frame to changge its
size,then i want to use ShowWindow(SW_SHOWMAXIMIZED) maximize window,but its not work
|
|
|
|
|
chybin
I dont konw that what is your Application type CDialog single document or...
Can you be more specific.
anyway maybe it is some helpful to you
AfxGetApp()->m_pMainWnd->ShowWindow(SW_MAXIMIZE);
|
|
|
|
|
to maximize a window you should use ShowWindow(SW_MAXIMIZE);
-Saurabh
|
|
|
|
|
Hope this is what you wanted.
void CDlgMaxTestDlg::OnMaximize() <br />
{<br />
ShowWindow(SW_MAXIMIZE) ; <br />
}<br />
<br />
void CDlgMaxTestDlg::OnRestore() <br />
{<br />
ShowWindow(SW_RESTORE) ;<br />
}
|
|
|
|
|
when window is max,I drag its border frame to change its size,then i use ShowWindow(SW_MAXIMIZE) to make it MAXIMIZE,but no effect. I think
sys still deems the window MAXIMIZE.
|
|
|
|
|
|
How I can change the color, font and fontsize of a static box and an Edit box.
|
|
|
|
|
|
How to change the background and the foreground color in a static control:
class CDescriptionCtrl : public CStatic
{
DECLARE_DYNAMIC(CDescriptionCtrl)
protected:
COLORREF m_colorText;
pDC->SetTextColor(m_colorText);
return (HBRUSH)m_brushBkgnd;
}
void CDescriptionCtrl::SetTextColor(const COLORREF rgbColor)
{
m_colorText = rgbColor;
RedrawWindow();
}
void CDescriptionCtrl::SetBkColor(const COLORREF rgbColor)
{
m_colorBkgnd = rgbColor;
m_brushBkgnd.DeleteObject();
m_brushBkgnd.CreateSolidBrush(rgbColor);
RedrawWindow();
}
You can set the font with CStatic::SetFont(...) method. Good luck!
|
|
|
|
|
To get ip address i have this code.
Do any one know any simple method to get current IP?
CString CSignIn::GetIP()
{
CString strIp;
WSADATA wsaData;
int nErrorCode = WSAStartup(MAKEWORD(1,1), &wsaData);
if (nErrorCode != 0) {
return _T("");
}
char strHostName[81];
if (gethostname(strHostName, 80)==0)
{
hostent *pHost = gethostbyname(strHostName);
if (pHost->h_addrtype == AF_INET)
{
in_addr **ppip=(in_addr**)pHost->h_addr_list;
while (*ppip)
{
in_addr ip=**ppip;
strIp = CString(inet_ntoa(ip));
ppip++;
if (strIp!=_T("")) {
break;
}
}
}
}
return strIp;
}
{/PRE>
JAYARAJ
|
|
|
|
|
|
How to make buttons on ToolBar with inequable Width?
I wish to create a application with multiframe
once you have opened several childframes,,there should be some corresponding buttons at the bottom of the mainframe.
when you click the button,corresponding childframe is showed.
I use the ToolBar to do that,but buttons on toolbar are all the same size.
in fact,different childframe has different length of titiles...
how can i make the buttons on toolbar show the titles of childframes according to the lenght of title.?
thanks
bruspark.
bruspark
|
|
|
|
|
bruspark wrote: How to make buttons on ToolBar with inequable Width?
Use a dialog bar.
Nibu thomas
Software Developer
|
|
|
|
|
thank you for your reply.
It seems that there is no relative member function to add a button to the CDialogBar.
If each time i add a button to the bar , i have to adjust the placement of buttons.,
With the increase of buttons int the bar ,that need do lots of work.
Thank you!
Bruspark
|
|
|
|
|
|
WhiteSky,thank u for your reply.
now,I am trying to use the CPropertySheet add views(May be derived from CView) to each page.
Bruspark
|
|
|
|
|
I made a project in Visual Studio 2005 with Unicode libraries enabled. The app I am building needs to support many languages (including the East Asian ones).
What does the Language property in the Resource View ( Resource View-->Right Click on a Dialog box-->Properties) affect? Should I set it to neutral? Or is it ok to leave the default setting on? (right now it's japanese, since i'm using a japanese OS)
Thanks!
|
|
|
|
|
I think this[^] will explain everything you are looking for.
|
|
|
|
|
i have no problem with localization and resource dll loading.
what i am concerned about is how this setting will affect the dialog box other than the strings resources (like the input method, etc).
|
|
|
|
|
Does the change in person mean that you typed 'I need to write in C++' and then entered your homework assignment ?
Either way, this is a great place to ask for help, but help means that you're stuck on something specific. The sort of broad level request you've made is more appropriate on places like rentacoder.
Christian Graus - Microsoft MVP - C++
|
|
|
|