This blog will show how to display a menu we designed in a dialog. 1.Insert a new dialog& a new menu in resourse view. dialog: menu: 2.Set their IDs that you can remember after which fill the menu blank in dialog properties view with the ID of your m…
1.确定取消对话框 代码: // 使用AlertDialog.Builder初始化对话框 AlertDialog.Builder builder0 = new AlertDialog.Builder(context); // 设置图标 builder0.setIcon(R.mipmap.ic_launcher); // 设置标题 builder0.setTitle("确定取消对话框"); // 设置显示内容 builder0.setMessage("点击确定还是取消?&quo…
1.MFC的“匈牙利标识符命名法”,这是一个约定,可以增加代码的可读性: 声明或定义了一个类,那么这个类可以以“C”(class)为前缀,如CHelloWorldDlg类: 定义一个无符号型的局部变量,可以用“u”(unsigned)为前缀,如UINT uPort; ULONG uFlags; 如果是int或long类型的变量,则以“n”为前缀: DWORD类型的变量前缀为“dw”: 字符数组以“sz”作为前缀: CString类的对象以“str”作为前缀: 指针以“lp”或“p”(long p…
原文转自 http://lishiqiang1988.blog.163.com/blog/static/41147912201382104631547/ VS2010的MFC对话框程序中添加菜单栏的过程,我大致分了这五步. 一.将Menu加入Resource视图中 在WorkSpace中的Resource视图下,在任意一个文件夹图标上,右击选择Insert(插入)选项,在弹出的对话框中选择Menu以后,再点击,new按钮,菜单就会添加成功了,但是现在还没有完成,还不能进行编译,因为现在的菜单时空…
1.确定取消对话框 代码: // 使用AlertDialog.Builder初始化对话框 AlertDialog.Builder builder0 = new AlertDialog.Builder(context); // 设置图标 builder0.setIcon(R.mipmap.ic_launcher); // 设置标题 builder0.setTitle("确定取消对话框"); // 设置显示内容 builder0.setMessage("点击确定还是取消?&quo…
void CMy322Dlg::OnButton1() { UpdateData(TRUE); m_crypt=m_plaintxt; for(int i=0;i<m_plaintxt.GetLength();i++) if(m_plaintxt.GetAt(i)+3<='z') m_crypt.SetAt(i,m_plaintxt.GetAt(i)+3); UpdateData(FALSE); } UpdateData(TRUE) :从编辑框读入字符串 UpdateData(FALSE):输…
CPaintDC dc(this); if (!m_hBitmap) return; image.Attach(m_hBitmap); CRect rect; GetClientRect(&rect);//获得控件所在的矩形区域 int width = rect.Width(); int height = rect.Height(); //...... CDC mDC; mDC.CreateCompatibleDC(&dc); CBitmap b; b.CreateCompatibleBi…
http://www.hawstein.com/posts/dp-novice-to-advanced.html…
以静态文本为例,分享一下怎么修改文本字体.大小.颜色.背景等参数.其他文本.控件等可参照修改. 1.修改字体.大小 这个很简单,首先在Dlg类中声明一个CFont类型的成员变量: 然后在类的初始化函数OnInitDialog()中添加以下两行代码: //设置静态文本字体大小 m_editFont.CreatePointFont(, _T("宋体")); m_Static.SetFont(&m_editFont); 2.改变编辑框文本颜色.背景颜色 右键点击该对话框-> 类…
This day saw the progress I achieved in creating a fusion of MFC frame and OpenCV code as well as some settled problems. But it is quite late now cause the time for me to prepare the small thesis of the Micro-computer course is not enough, if I spent…