本文整理汇总了C++中CButton::ModifyStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ CButton::ModifyStyle方法的具体用法?C++ CButton::ModifyStyle怎么用?C++ CButton::ModifyStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CButton
的用法示例。
在下文中一共展示了CButton::ModifyStyle方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OnInitDialog
BOOL CAVCameraDlg::OnInitDialog()
{
CDialogEx::OnInitDialog();
// 设置此对话框的图标。当应用程序主窗口不是对话框时,框架将自动
// 执行此操作
SetIcon(m_hIcon, TRUE); // 设置大图标
SetIcon(m_hIcon, FALSE); // 设置小图标
CButton* pButton = (CButton*)GetDlgItem(IDC_BUTTON_START);
ASSERT(pButton);
pButton->ModifyStyle(0, BS_BITMAP);
pButton->SetBitmap(LoadBitmap(AfxGetInstanceHandle(), MAKEINTRESOURCE(IDB_PNG_START)));
// TODO: 在此添加额外的初始化代码
_dc = GetDlgItem(IDC_VIDEO_PLAYBACK)->GetDC();
_camera.refresh_sign.connect(boost::bind(&CAVCameraDlg::UpdateVideoFrame, this));
UpdateStatus(VideoMgr::CREATED);
return TRUE; // 除非将焦点设置到控件,否则返回 TRUE
}
示例2: UpdateUI
void CDlgManager::UpdateUI()
{
CButton btn;
SetButtons ( );
switch( m_ctrlState )
{
case Control_Logon:
ShowLoginInputs ( );
GetDlgItem(IDC_STATIC_COMMENT0)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_STATIC_COMMENT1)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_STATIC_COMMENT2)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_STATIC_COMMENT3)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_STATIC_COMMENT4)->ShowWindow( SW_SHOW );
// 下面的几行与Tab顺序有关, 所以不能随意执行动位置
//GetDlgItem(IDCANCEL)->SetWindowPos( &CWnd::wndTop,
// 110, 302, 76, 22, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDOK)->SetWindowPos( &CWnd::wndTop,
90, 232, 76, 22, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_COMMENT0)->SetWindowPos( &CWnd::wndTop,
10, 36, 245, 110, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_COMMENT1)->SetWindowPos( &CWnd::wndTop,
37, 72, 56, 20, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_SERVERADDRESS)->SetWindowPos( &CWnd::wndTop,
98, 188, 136, 26, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_PASSWARD)->SetWindowPos( &CWnd::wndTop,
98, 98, 136, 26, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_USERNAME)->SetWindowPos( &CWnd::wndTop,
98, 68, 136, 26, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_COMMENT2)->SetWindowPos( &CWnd::wndTop,
37, 102, 56, 20, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_COMMENT3)->SetWindowPos( &CWnd::wndTop,
37, 165, 136, 20, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_COMMENT4)->SetWindowPos( &CWnd::wndTop,
37, 225, 136, 20, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_PORT)->SetWindowPos( &CWnd::wndTop,
98, 248, 136, 26, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_MARKED) -> ShowWindow( SW_HIDE );
GetDlgItem(IDC_CURRENTNUM) -> ShowWindow( SW_HIDE );
GetDlgItem(IDC_STATIC_COMMENT0)->SetWindowText( _T("用户登陆信息") );
GetDlgItem(IDC_STATIC_COMMENT1)->SetWindowText( _T("帐号:") );
GetDlgItem(IDC_USERNAME)->SetWindowText( m_strUserName );
GetDlgItem(IDC_STATIC_COMMENT2)->SetWindowText( _T("密码:") );
GetDlgItem(IDC_PASSWARD)->SetWindowText( _T("") );
GetDlgItem(IDC_STATIC_COMMENT3)->SetWindowText( _T("服务器地址:") );
GetDlgItem(IDC_SERVERADDRESS)->SetWindowText( m_strServerAddress );
// GetDlgItem(IDC_STATIC_COMMENT4)->SetWindowText( _T(" 端口:") );
GetDlgItem(IDC_STATIC_COMMENT4)->SetWindowText( _T(" ") );
// GetDlgItem(IDC_PORT)->SetWindowText( _T(m_lPort) );
GetDlgItem(IDC_PORT)->ShowWindow( SW_HIDE );
GetDlgItem(IDOK)->SetWindowText( _T("登 陆") );
GetDlgItem(IDCANCEL)->SetWindowText( _T("取 消") );
btn.Attach(GetDlgItem(IDOK)->GetSafeHwnd());
btn.ModifyStyle(0,BS_DEFPUSHBUTTON);
btn.Detach();
GetDlgItem(IDC_USERNAME) ->SetFocus();
((CEdit*)GetDlgItem(IDC_USERNAME))->SetSel( 0, 10 );
break;
case Control_Logon_Wait:
ShowLoginInputs ( SW_HIDE );
GetDlgItem(IDC_CURRENTNUM) ->ShowWindow( SW_HIDE );
GetDlgItem(IDC_STATIC_COMMENT0)->ShowWindow( SW_HIDE );
GetDlgItem(IDC_STATIC_COMMENT2)->ShowWindow( SW_HIDE );
GetDlgItem(IDC_STATIC_COMMENT3)->ShowWindow( SW_HIDE );
GetDlgItem(IDC_STATIC_COMMENT4)->ShowWindow( SW_HIDE );
GetDlgItem(IDC_STATIC_COMMENT1)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_STATIC_COMMENT1)->SetWindowText( _T("系统正在连接到服务器\r\n\r\n请稍候...") );
GetDlgItem(IDC_STATIC_COMMENT1)->SetWindowPos( &CWnd::wndTop,
37, 172, 180, 80, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
break;
case Control_Regist_Wait:
GetDlgItem(IDC_STATIC_COMMENT1)->SetWindowText( _T("正在连接服务器!\r\n\r\n") );
GetDlgItem(IDC_STATIC_COMMENT1)->SetWindowPos( &CWnd::wndTop,
37, 62, 180, 80, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
GetDlgItem(IDC_STATIC_COMMENT2)->ShowWindow( SW_SHOW );
GetDlgItem(IDC_STATIC_COMMENT2)->SetWindowText( _T("系统开始登陆到服务器\r\n\r\n请稍候...") );
GetDlgItem(IDC_STATIC_COMMENT2)->SetWindowPos( &CWnd::wndTop,
37, 162, 180, 80, SWP_FRAMECHANGED | SWP_SHOWWINDOW );
break;
case Control_Head_Registed: // 组长登陆服务器成功后
//.........这里部分代码省略.........