Click here to Skip to main content
15,914,481 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHelp me please,Urgent!! Pin
ucc80122-Feb-03 15:25
ucc80122-Feb-03 15:25 
GeneralRe: Help me please,Urgent!! Pin
Roger Allen24-Feb-03 1:20
Roger Allen24-Feb-03 1:20 
GeneralWin32 Wrapper Class - Problem with window creation Pin
Skute22-Feb-03 14:01
Skute22-Feb-03 14:01 
GeneralRe: Win32 Wrapper Class - Problem with window creation Pin
Jambolo22-Feb-03 20:25
Jambolo22-Feb-03 20:25 
GeneralOnwer Draw spin control only Pin
Wolfram Steinke22-Feb-03 12:53
Wolfram Steinke22-Feb-03 12:53 
GeneralProblem with Developer Studio (VC++ ver 4.0) Pin
Still learning how to code22-Feb-03 11:43
Still learning how to code22-Feb-03 11:43 
GeneralRe: Problem with Developer Studio (VC++ ver 4.0) Pin
Still learning how to code22-Feb-03 12:17
Still learning how to code22-Feb-03 12:17 
GeneralDynamic CListView Column Sizes Pin
Jonah Bishop22-Feb-03 11:27
Jonah Bishop22-Feb-03 11:27 
I have an application based on the CListView class, and I'd like to do the following: when a user resizes the frame of my application, I'd like the columns in the list view to resize themselves appropriately. My problem is that I'm a little confused as to when (and where) I do this.

Currently, I am handling the WM_SIZE method in the view class. Here is the code I'm using (in the OnSize() method):

CListView::OnSize(nType, cx, cy);
	
if(m_List->GetSafeHwnd() != NULL)
{
    CRect rectList;
    m_List->GetClientRect(&rectList);
    int listwidth = (rectList.Width() - GetSystemMetrics(SM_CXVSCROLL));
    int nColInterval = listwidth / 10;

    m_List->SetColumnWidth(0, 4 * nColInterval);
    m_List->SetColumnWidth(1, listwidth - (4 * nColInterval));
}
I have several problems with this code. When the vertical scroll bar actually does appear, the column sizes aren't quite right. I want a space in the header control for the vertical scroll bar's top arrow (hence the GetSystemMetrics() call above). But when the vertical scroll bar shows up, it looks like twice the distance is inserted in the header control.

Another problem is that when I switch from any non-details view to the details view, the size is not updated initially. So, for example, if I'm in "Large Icons" mode and resize the window, then switch to "Details" mode, the columns are sized for the previous window size, not the current size.

Can anyone shed any light on what I should do for this? Any help would be greatly appreciated!

Thanks,

Jonah Bishop
Visit JGB Productions
GeneralRe: How do you write a program to block a port using mfc/c++? Pin
Taka Muraoka23-Feb-03 0:45
Taka Muraoka23-Feb-03 0:45 
QuestionHow can I use MFC Classes in Win32 application? Pin
Behzad Ebrahimi22-Feb-03 10:54
Behzad Ebrahimi22-Feb-03 10:54 
AnswerRe: How can I use MFC Classes in Win32 application? Pin
Nish Nishant22-Feb-03 11:00
sitebuilderNish Nishant22-Feb-03 11:00 
GeneralRe: How can I ..... [Thank you] Pin
Behzad Ebrahimi22-Feb-03 11:07
Behzad Ebrahimi22-Feb-03 11:07 
Generaldebug version crashes on base Create(); Pin
nss22-Feb-03 10:22
nss22-Feb-03 10:22 
GeneralRe: debug version crashes on base Create(); Pin
nss22-Feb-03 10:54
nss22-Feb-03 10:54 
GeneralResolved: weird conclusion Pin
nss22-Feb-03 13:44
nss22-Feb-03 13:44 
GeneralBitmaps Pin
Dennis L22-Feb-03 9:50
Dennis L22-Feb-03 9:50 
GeneralRe: Bitmaps Pin
MAAK22-Feb-03 10:42
MAAK22-Feb-03 10:42 
GeneralRe: Bitmaps Pin
Dennis L22-Feb-03 11:32
Dennis L22-Feb-03 11:32 
GeneralRe: Bitmaps Pin
MAAK22-Feb-03 11:50
MAAK22-Feb-03 11:50 
GeneralRe: Bitmaps....Thanks Pin
Dennis L22-Feb-03 22:38
Dennis L22-Feb-03 22:38 
GeneralRe: Bitmaps Pin
Chintan22-Feb-03 21:05
Chintan22-Feb-03 21:05 
Generalcreating objects indirectly Pin
Chicken6422-Feb-03 9:01
sussChicken6422-Feb-03 9:01 
GeneralRe: creating objects indirectly Pin
Nish Nishant22-Feb-03 9:06
sitebuilderNish Nishant22-Feb-03 9:06 
GeneralRe: creating objects indirectly Pin
Chris Losinger22-Feb-03 9:09
professionalChris Losinger22-Feb-03 9:09 
GeneralRe: creating objects indirectly Pin
Chicken6422-Feb-03 9:20
sussChicken6422-Feb-03 9:20 

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.