12 2023 档案
摘要:▲ 样式 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using Sy
阅读全文
摘要:直接遍历: foreach (Control ctrl in cogToolBlockEditV2.Controls) { if (ctrl is SplitContainer spc) // 设置默认宽度 { string n = spc.Name; spc.SplitterDistance =
阅读全文
摘要:// 返回 str 从前往后,第 count 次出现 ch 字符处的索引位置,失败返回 -1; protected static int IndexOf(string str, char ch, int count) { if (count < 1) { return -1; } int index
阅读全文
摘要:▲ 效果 头文件新增空间指针: private: CStatic* pBMP; BOOL CMFCApplicationBMPDlg::OnInitDialog() 里面初始化: // TODO: 在此添加额外的初始化代码 // 初始化字段 pBMP = (CStatic*)GetDlgItem(I
阅读全文
摘要:▲ 样式Demo 关联控件变量m_CList,在属性中将视图(View)设置成Report(报表)模式。 在BOOL CMFCApplication4LlisBoxDlg::OnInitDialog()初始化函数中添加测试代码: // TODO: 在此添加额外的初始化代码 //m_CList.Set
阅读全文
摘要:.cpp头文件中需包括 using namespace System; //String^库文件 using namespace System::Runtime::InteropServices; //Marchal库文件 函数内容 char* c = "adsfdasf"; String^ str
阅读全文
摘要:托管C++ 这个项目名:CppCLI。 Animals.h #pragma once using namespace System; namespace Zoological { public ref class Animals { public: int GetLegs(); void SetLe
阅读全文
摘要:7)组合框(下拉框)CComboBox a) 获取内容:CComboBox::GetLBText 其它接口和 CListBox 的用法几乎一样 b) 属性设置 1) data: 设置内容,不同内容间同英文的分号“;”分隔 2) type // DropDown之类的选项,可编辑和不可编辑。 这个和上
阅读全文
摘要:▲ 增删改查 6)列表框CListBox a) 给列表框添加一个字符串 CListBox::AddString b) 选中列表列表框某一项,自动触发事件:LBN_SELCHANGE 1)获取当前选中项 CListBox::GetCurSel 2)获取指定位置的内容 CListBox::GetText
阅读全文