1. Create a BCG project bcgpproplistsingle Based on the dialog box.
2. Add the variable cbcgpproplistsingledlg.
Cbcgpproplist m_prop;
3. cbcgpproplistsingledlg: oninitdialog initialize the grid control.
M_prop.create (ws_child | ws_visible | ws_tabstop | ws_border, crect (0, 0, 200,200), this, (uint)-1 );
M_prop.enableheaderctrl (false, _ T (""), _ T (""); // disable the header
M_prop.enabledesciptionarea (); // display the description area
Cbcgpprop * pgroupgeneral1 = new cbcgpprop (_ T ("basic info "));
// Name, string
Cbcgpprop * psub1 = new cbcgpprop (_ T ("name"), 1, _ T (""), _ T (" "));
Psub1-> enable (false); // cannot be edited
Pgroupgeneral1-> addsubitem (psub1 );
// Age, long type
Cbcgpprop * psub2 = new cbcgpprop (_ T ("Age"), 2, (long) 3, _ T ("Age, full year old. "));
Pgroupgeneral1-> addsubitem (psub2 );
M_prop.addproperty (pgroupgeneral1 );
Cbcgpprop * pgroupgeneral = new cbcgpprop (_ T ("contact information "));
// Name, string
Cbcgpprop * psub3 = new cbcgpprop (_ T ("QQ"), 3, _ T ("252800619"), _ T (""));
Pgroupgeneral-> addsubitem (psub3 );
// Age, long type
Cbcgpprop * psub4 = new cbcgpprop (_ T ("Mailbox"), 4, _ T (""), _ T (""));
Pgroupgeneral-> addsubitem (psub4 );
M_prop.addproperty (pgroupgeneral );
4. Run Ctrl + F5. Effect.
1. Click the row. A prompt is displayed below.
2. You can edit the age value.
3. Click the plus sign to expand and then click the minus sign to contract.
Download source code:
BCG attribute list
BCG attribute list