Collapsed list view report control

I'm try to set up an EXCEL like window, which
apparently one can do with a REPORT control.
I actually get it work, but all the columns are scrunched to
the left when the window comes up, forcing the user to
move the partions.

I'm using Visual C++ 7.0.

Here' the code.
Thanks,
Ihor
 P.S.  Is there an easier way of inserting a line of data??
-----------------------------------------------------------------------
    CRect rect(16 ,60,450 ,250);
    m_pendlistctrl.Create(WS_VISIBLE|WS_CHILD|LVS_REPORT,rect,
    			      this,IDD_WIRE_DIALOG);
   //m_pendlistctrl is a CListCtrl
    m_pendlistctrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE,0,
        LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT);
    m_pendlistctrl.InsertColumn(0,"EXTID",LVCFMT_LEFT,10);
    m_pendlistctrl.InsertColumn(1,"CUSTOMER",LVCFMT_LEFT,20);
	m_pendlistctrl.InsertColumn(2,"VALUE",LVCFMT_RIGHT,10);
	m_pendlistctrl.InsertColumn(3,"TYPE",LVCFMT_LEFT,10);
	// HEADER -complete.

    //CALL code to initialize values...  Read from db, Put
    // in subrtn ??.  Not sure how to enter a line at a time.
    // Can only enter an element ...
    LV_ITEM lvi;
    lvi.mask = LVIF_TEXT | LVIF_IMAGE;
    lvi.iItem = 0;
    lvi.iSubItem = 0;
    lvi.pszText   = "58311NY";
    int inx = m_pendlistctrl.InsertItem(&lvi);

    m_pendlistctrl.SetItemText(inx,1,"THE BANK");
    m_pendlistctrl.SetItemText(inx,2,"-68213.89");
    m_pendlistctrl.SetItemText(inx,3,"58113M_CUST");

0
ikinal (9)
9/10/2007 7:21:53 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
642 Views

Similar Articles

[PageSpeed] 19

Increase the width (4th parameter) you are passing to InsertColumn. 10 and 
20 pixels are very small!

AliR.


"ikinal" <ikinal@ieee.org> wrote in message 
news:1189452113.960991.229360@d55g2000hsg.googlegroups.com...
> I'm try to set up an EXCEL like window, which
> apparently one can do with a REPORT control.
> I actually get it work, but all the columns are scrunched to
> the left when the window comes up, forcing the user to
> move the partions.
>
> I'm using Visual C++ 7.0.
>
> Here' the code.
> Thanks,
> Ihor
> P.S.  Is there an easier way of inserting a line of data??
> -----------------------------------------------------------------------
>    CRect rect(16 ,60,450 ,250);
>    m_pendlistctrl.Create(WS_VISIBLE|WS_CHILD|LVS_REPORT,rect,
>          this,IDD_WIRE_DIALOG);
>   //m_pendlistctrl is a CListCtrl
>    m_pendlistctrl.SendMessage(LVM_SETEXTENDEDLISTVIEWSTYLE,0,
>        LVS_EX_GRIDLINES|LVS_EX_FULLROWSELECT);
>    m_pendlistctrl.InsertColumn(0,"EXTID",LVCFMT_LEFT,10);
>    m_pendlistctrl.InsertColumn(1,"CUSTOMER",LVCFMT_LEFT,20);
> m_pendlistctrl.InsertColumn(2,"VALUE",LVCFMT_RIGHT,10);
> m_pendlistctrl.InsertColumn(3,"TYPE",LVCFMT_LEFT,10);
> // HEADER -complete.
>
>    //CALL code to initialize values...  Read from db, Put
>    // in subrtn ??.  Not sure how to enter a line at a time.
>    // Can only enter an element ...
>    LV_ITEM lvi;
>    lvi.mask = LVIF_TEXT | LVIF_IMAGE;
>    lvi.iItem = 0;
>    lvi.iSubItem = 0;
>    lvi.pszText   = "58311NY";
>    int inx = m_pendlistctrl.InsertItem(&lvi);
>
>    m_pendlistctrl.SetItemText(inx,1,"THE BANK");
>    m_pendlistctrl.SetItemText(inx,2,"-68213.89");
>    m_pendlistctrl.SetItemText(inx,3,"58113M_CUST");
> 


0
AliR3470 (3236)
9/10/2007 7:46:59 PM
Reply:

Similar Artilces: