查询条件较多,可以选择其中的1-n条,
设置chexk box 选中1
((CButton*)(GetDlgItem(ID)))->SetCheck(TRUE);
得到选中状态1
((CButton*)(GetDlgItem(ID)))->GetCheck();
要使 CComboBox 不自动排序 去掉styles->sort前面的勾
VC6.0下设置编辑框不可见将visable勾去掉
文章作者: 张拓
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 张拓的博客!
相关推荐

2013-07-12
MFC加载位图和图标
从文件加载位图 1234567891011121314151617181920#pragma once // ZBitmap从文件加载位图资源class ZBitmap{private: HBITMAP m_hBitmap; CString m_FileName;public: ZBitmap(const char* pFileName); ZBitmap(); virtual ~ZBitmap();public: HBITMAP GetHandle(); BOOL LoadBitmapTo(const char* pFileName); private: // stop copy ZBitmap (const ZBitmap&); ZBitmap operator=(const ZBitmap&);}; 123456789101112131415161718192021222324252627282930313233343536373839404142434445#include "StdAfx.h"#include &q...

2013-07-29
MFC选择文件存放路径
123456789101112131415161718192021222324BROWSEINFO bi; ZeroMemory(&bi,sizeof(BROWSEINFO)); //指定存放文件的默认文件夹路径 bi.ulFlags = BIF_RETURNONLYFSDIRS; bi.lpszTitle="选择文件存放路径"; //添加提示语句 LPMALLOC pMalloc; LPITEMIDLIST pidl = SHBrowseForFolder(&bi);//以默认路径打开浏览文件夹对话框 char szcSavePath[MAX_PATH]; CString szSavePath=""; if(pidl != NULL) { SHGetPathFromIDList(pidl, szcSavePath);//文件夹路径存放入szcSavePath中 szSavePath.Form...

2013-07-30
MFC中导出excel表格
MFC中导出excel表格 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192_Application app; Workbooks books;_Workbook book;Worksheets sheets;_Worksheet sheet;Range range;Range xlsCells,xlsCol; COleVariant vResult;COleVariant covTrue((short)TRUE), covFalse((short)FALSE), covOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR); //*****//创建Excel 2000服务器(启动Excel)if(!app.Create...

2013-07-31
MFC中初始化opengl的类3D视图
123456789101112131415161718192021222324252627282930313233343536#pragma once class InitOpenGL3D{public: InitOpenGL3D(void); virtual ~InitOpenGL3D(void);public: // 在OnCreate函数中调用此函数: int InitOpenGL3D::OnCreate(LPCREATESTRUCT lpCreateStruct, CClientDC* pDC); // 在Ondestroy()中调用 void InitOpenGL3D::OnDestroy(); // 在OnSize()调用 void InitOpenGL3D::OnSize(UINT nType, int cx, int cy); // 在OnPaint()中调用,窗口框架重绘 void InitOpenGL3D::OnPaint();private: // InitOpenGL3D 消息处...

2013-08-02
MFC窗口透明
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758// 在OnCreate()或OnInitDialog()加入以下代码 SetWindowLong(this->GetSafeHwnd() , GWL_EXSTYLE, GetWindowLong(this->GetSafeHwnd() , GWL_EXSTYLE)|WS_EX_LAYERED); SetLayeredWindowAttributes(RGB(0, 0, 0), 125, 0x2/*0x1 | 0x2*/); // SetWindowLong是一个Windows API函数。该函数用来改变指定窗口的属性。 LONG SetWindowLong(HWND hWnd, // handle to windowint nlndex, ...

2013-08-13
设置List控件样式
12345m_ctrlListGunInfo.SetExtendedStyle(LVS_EX_FLATSB |LVS_EX_FULLROWSELECT |LVS_EX_HEADERDRAGDROP |LVS_EX_ONECLICKACTIVATE |LVS_EX_GRIDLINES); 原型123DWORD SetExtendedStyle( DWORD dwNewStyle ); Parameters参数dwNewStyleA combination of extended styles to be used by the list view control. For a descriptive list of these styles, see the Extended List View Styles topic in the Platform SDK. 结合扩展样式使用的列表视图控件。描述这些风格的列表,在平台SDK参考扩展列表视图风格主题。 Return Value 返回值A combination of the previous extended...
公告
每天都有一个好心情