Click here to Skip to main content
15,921,530 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CEdit Control Problem - Bkgr color Pin
Gerry23-Jul-01 22:35
Gerry23-Jul-01 22:35 
Generalremote files Pin
23-Jul-01 6:42
suss23-Jul-01 6:42 
GeneralRe: remote files Pin
Todd Smith23-Jul-01 7:37
Todd Smith23-Jul-01 7:37 
GeneralRe: remote files Pin
Anders Molin23-Jul-01 9:36
professionalAnders Molin23-Jul-01 9:36 
GeneralRe: remote files Pin
Carlos Antollini23-Jul-01 10:22
Carlos Antollini23-Jul-01 10:22 
GeneralUrgent::Problem in full-selection of rows in a List view Pin
manohar23-Jul-01 6:06
manohar23-Jul-01 6:06 
GeneralRe: Urgent::Problem in full-selection of rows in a List view Pin
Paolo Messina23-Jul-01 12:57
professionalPaolo Messina23-Jul-01 12:57 
GeneralCode Here Pin
manohar23-Jul-01 18:55
manohar23-Jul-01 18:55 
Hi,
thanx for the quick reply.I am sending some portion of the code.
Here CTest1View is derived from CListView.The bitmap is a small red cicle , and the background is white.

Here is the code for the PreCreateWindow method

BOOL CTest1View::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.style |= (LVS_SHOWSELALWAYS | LVS_REPORT );
return CListView::PreCreateWindow(cs);
}

Here is the code for the OnCreate method.

int CTest1View::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CListView::OnCreate(lpCreateStruct) == -1)
return -1;
CListCtrl &lc = GetListCtrl();
LVCOLUMN lvCol;
LVITEM lvItem;
int n, x;
DWORD dwOldBits;
dwOldBits = lc.GetExtendedStyle();
dwOldBits |= LVS_EX_FULLROWSELECT;
dwOldBits |= LVS_EX_SUBITEMIMAGES | LVS_TYPEMASK;
dwOldBits |= LVS_EX_HEADERDRAGDROP |LVS_NOSCROLL;
// images in the subitems
lc.SetExtendedStyle(dwOldBits);

COLORREF crBkColor = ::GetSysColor(COLOR_WINDOW);
m_pDocImgLst = new CImageList();
BOOL bCreate = m_pDocImgLst->Create(22, 14, ILC_MASK, 2, 0);
CBitmap bmp;
int nImgIndx = -1;
bmp.LoadBitmap(IDB_BITMAP1);
n=m_pDocImgLst->Add(&bmp,RGB(255,255,255));
bmp.DeleteObject();
lc.SetImageList(m_pDocImgLst,LVSIL_SMALL);
for (int i = 0; i < 3; i++)
{
lvCol.mask = LVCF_IMAGE | LVCF_WIDTH|LVCF_FMT|LVCF_SUBITEM|LVCF_TEXT;
lvCol.fmt = LVCFMT_BITMAP_ON_RIGHT;
lvCol.cx = 50;
lvCol.pszText = "aaa";
lvCol.iImage = 0;
lvCol.iOrder = 2;
int er = lc.InsertColumn(i,&lvCol);
}
for(int k=0;k<10;k++)
{
lvItem.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_PARAM;
lvItem.iItem = k;
lvItem.iSubItem = 0;
lvItem.cchTextMax = 50;
lvItem.iImage = 0;
lvItem.pszText = "Manohar";
lc.InsertItem(&lvItem);
}

LVITEM lvItem1;
for(int j=0;j<10;j++)
{

lvItem1.mask = LVIF_IMAGE |LVIF_TEXT;
lvItem1.iItem = j;
lvItem1.iSubItem = 1;
lvItem1.pszText = "ZZZZ";
lvItem1.iImage = 0;
lvItem1.state = 2;
lvItem1.stateMask = 2;

lc.SetItem(&lvItem1);

}


// TODO: Add your specialized creation code here

return 0;
}

Please let me know if this is not enough.....
Thanx again.......
Smile | :)

Waiting for ur reply
GeneralRe: Code Here Pin
Paolo Messina24-Jul-01 3:26
professionalPaolo Messina24-Jul-01 3:26 
Generaltype of parameters Pin
Gérald Mercet23-Jul-01 5:18
Gérald Mercet23-Jul-01 5:18 
GeneralRe: type of parameters Pin
Not Active23-Jul-01 9:11
mentorNot Active23-Jul-01 9:11 
GeneralMulti-Line VC Constants Pin
AJ12323-Jul-01 4:55
AJ12323-Jul-01 4:55 
GeneralRe: Multi-Line VC Constants Pin
23-Jul-01 5:08
suss23-Jul-01 5:08 
GeneralRe: Multi-Line VC Constants Pin
AJ12323-Jul-01 6:05
AJ12323-Jul-01 6:05 
GeneralNEED TO SET A DOUBLE BACKSLASH Pin
23-Jul-01 4:55
suss23-Jul-01 4:55 
GeneralRe: NEED TO SET A DOUBLE BACKSLASH Pin
Not Active23-Jul-01 5:41
mentorNot Active23-Jul-01 5:41 
Generalfunction does not do what i need Pin
23-Jul-01 9:29
suss23-Jul-01 9:29 
GeneralRe: function does not do what i need Pin
Jim A. Johnson23-Jul-01 10:07
Jim A. Johnson23-Jul-01 10:07 
GeneralRe: function does not do what i need Pin
24-Jul-01 6:51
suss24-Jul-01 6:51 
GeneralRe: function does not do what i need Pin
Erik Funkenbusch25-Jul-01 21:35
Erik Funkenbusch25-Jul-01 21:35 
GeneralFormat a String in a EditBox Pin
youssef23-Jul-01 4:10
youssef23-Jul-01 4:10 
GeneralRe: Format a String in a EditBox Pin
Not Active23-Jul-01 5:42
mentorNot Active23-Jul-01 5:42 
GeneralActive-X Control Redrawing Pin
Jared Allen23-Jul-01 3:33
Jared Allen23-Jul-01 3:33 
GeneralRe: Active-X Control Redrawing Pin
23-Jul-01 3:53
suss23-Jul-01 3:53 
GeneralRe: Active-X Control Redrawing Pin
23-Jul-01 14:14
suss23-Jul-01 14:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.