我的程序是一个基于对话框的小测试程序
老板要我把测试结果画成一个小表格显示出来,请问用什么方法画?数据用什么来保存?帮忙帮忙,谢谢谢谢!!

解决方案 »

  1.   

    简单的用ListBox,复杂的用ListCtrl
      

  2.   

    你是不是要把对话框输入的内容导入到表格里..?-------
    ODBC
    用access做个表格
      

  3.   

    小表格一ActiveX控件,VC自带一个DataGrid控件
      

  4.   

    ListCtrlHWND hList = GetDlgItem(hWnd,IDC_LIST);
    LVITEM LvItem;
    LVCOLUMN LvCol; memset(&LvItem,0,sizeof(LvItem)); // Zero struct's Members//  Setting properties Of members:
    LvItem.mask=LVIF_TEXT;   // Text Style
    LvItem.cchTextMax = 256; // Max size of test
    LvItem.iItem=0;          // choose item  
    LvItem.iSubItem=0;       // Put in first coluom
    LvItem.pszText="Item 0"; // Text to display (can be from a char variable) (Items)Adding an item via the button:
    case IDC_ADDITEM:
    {
       int iItem;
       char ItemText[100];   iItem=SendMessage(hList,LVM_GETITEMCOUNT,0,0); // number of items
                               
       GetDlgItemText(hWnd,IDC_ADD,ItemText,100); // get text from editobx   if((lstrlen(ItemText))==0)  // check if items exist
       {
         MessageBox(hWnd,"Please Write Some Text",
                  "Error",MB_OK|MB_ICONINFORMATION);
         break;
       }   LvItem.iItem=iItem;   // choose item to enter to 
       LvItem.iSubItem=0;    // Put in first coluom (no need subitems)   // Text to display (can be from a char variable) (Items)
       LvItem.pszText=ItemText;
       // Send item text to the Listview
       SendMessage(hList,LVM_INSERTITEM,0,(LPARAM)&LvItem);
    }
    break;Adding a Subitem via the button:
    case IDC_ADDSUBITEM:
    {
      int Item,i;
      char SubItemText[100];  Item=SendMessage(hList,LVM_GETITEMCOUNT,0,0); // number of items  GetDlgItemText(hWnd,IDC_ADDSUB,SubItemText,100); // get text from editobx  if((lstrlen(SubItemText))==0)  // check if items exist 
      {
        MessageBox(hWnd,"Please Write Some Text", 
                 "Error",MB_OK|MB_ICONINFORMATION);
        break;
      }  // choose the item-1 (we can't add subitems to non existing item
      LvItem.iItem=Item-1;  for(i=1;i<=5;i++)        // add 5 subitems
      {
        // Text to display (can be from a char variable) (Items)
        LvItem.pszText=SubItemText;
        // Put in coluom of index i
        LvItem.iSubItem=i;       SendMessage(hList,LVM_SETITEM,0,
          (LPARAM)&LvItem); // send Subitem text to listview
      }
    }
    break;
      

  5.   

    刚才这位兄弟的代码老弟真地看不懂,我是新学的呵
    我把问题在说详细一点,盼望高手解答:程序有一个USB接口,接口接受的数据经过计算会形成结果,这些结果
    意识需要显示出来,所以想在对话框上做一个表格,一边测试一边显示,
    另外每次测试的结果需要保存下来,因此希望能够保存成文件的形式,
    最好是能把表格直接放到文件里,保存的文件打开后能直接看到表格,
    这样当然最好,如果不行,也可以只保存数据,每次用程序来显示表格。请高手帮忙解答一下,或者说个思路,我自己去想具体的办法,点数好像给少了
    成功的话我另外开个帖送分,谢谢!!!