Click here to Skip to main content
15,915,093 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CString Question Pin
Christian Graus6-Jun-02 20:54
protectorChristian Graus6-Jun-02 20:54 
GeneralRe: CString Question Pin
Nish Nishant6-Jun-02 21:43
sitebuilderNish Nishant6-Jun-02 21:43 
Generalframe flashed Pin
Steve L.6-Jun-02 16:19
Steve L.6-Jun-02 16:19 
GeneralRe: frame flashed Pin
Paul M Watt6-Jun-02 17:26
mentorPaul M Watt6-Jun-02 17:26 
GeneralScroll bars! Pin
wilche6-Jun-02 15:31
wilche6-Jun-02 15:31 
GeneralRe: Scroll bars! Pin
Ernest Laurentin6-Jun-02 19:44
Ernest Laurentin6-Jun-02 19:44 
GeneralRe: Scroll bars! Pin
wilche10-Jun-02 16:15
wilche10-Jun-02 16:15 
Generalgrid column resize Pin
BlackDogEngineering6-Jun-02 14:10
BlackDogEngineering6-Jun-02 14:10 
I'm trying to programmatically size columns of a MSFlexGrid, but I don't understand, and have not been able to find documented, the proper way to do this.

In my case, I have a grid control on a dialog (it happens to be a tabbed dialog, but I don't know that that matters) and it will have 5 columns. I've put the following code in the OnInitDialog() function:

CRect rc;
GetClientRect(rc);
int Width = rc.Width();
Width /= (CellsPerRow + 1); // +1 is to account for label column
for ( int i=0; i < CellsPerRow+1; i++ )
{
   m_TheGrid.SetColWidth(i, Width );
}

When this code executes, all the columns are tiny, scrunched up on the left side of the control. Dead | X|

The docs for SetColWidth indicate that the argument is in "twips".
I have not been able to figure out what the units of CRect are.

So one question is: How do I convert from the CRect unit to twips. Presumably this is screen resolution dependent.

Another question/problem that I'm sure I'll have to face is: how to I account for the width of the vertical scroll bar on the right of the control. I have the scroll bar enabled, and I'm betting that the GetClientRect probably includes the scroll bar in its area.

Ron
General_variant_t vs VARIANT Pin
6-Jun-02 13:11
suss6-Jun-02 13:11 
GeneralRe: _variant_t vs VARIANT Pin
Christian Graus6-Jun-02 13:20
protectorChristian Graus6-Jun-02 13:20 
GeneralRe: _variant_t vs VARIANT Pin
Paul M Watt6-Jun-02 17:40
mentorPaul M Watt6-Jun-02 17:40 
GeneralBitmap to buffer to display Pin
Guibz6-Jun-02 12:14
Guibz6-Jun-02 12:14 
GeneralRe: Bitmap to buffer to display Pin
Christian Graus6-Jun-02 13:00
protectorChristian Graus6-Jun-02 13:00 
Questionhow to capture the screen efficiently? Pin
6-Jun-02 12:13
suss6-Jun-02 12:13 
AnswerRe: how to capture the screen efficiently? Pin
Paul M Watt6-Jun-02 17:45
mentorPaul M Watt6-Jun-02 17:45 
AnswerRe: how to capture the screen efficiently? Pin
Mike Nordell7-Jun-02 1:54
Mike Nordell7-Jun-02 1:54 
QuestionHow do i convert char * to LPOLESTR? Pin
redeemer6-Jun-02 11:27
redeemer6-Jun-02 11:27 
AnswerRe: How do i convert char * to LPOLESTR? Pin
Christian Graus6-Jun-02 11:40
protectorChristian Graus6-Jun-02 11:40 
GeneralRe: How do i convert char * to LPOLESTR? Pin
redeemer6-Jun-02 12:52
redeemer6-Jun-02 12:52 
GeneralRe: How do i convert char * to LPOLESTR? Pin
Christian Graus6-Jun-02 12:59
protectorChristian Graus6-Jun-02 12:59 
GeneralRe: How do i convert char * to LPOLESTR? Pin
redeemer6-Jun-02 13:01
redeemer6-Jun-02 13:01 
GeneralRe: How do i convert char * to LPOLESTR? Pin
Christian Graus6-Jun-02 13:18
protectorChristian Graus6-Jun-02 13:18 
GeneralRe: How do i convert char * to LPOLESTR? Pin
Ernest Laurentin6-Jun-02 19:26
Ernest Laurentin6-Jun-02 19:26 
GeneralDrawing tool Pin
Haakon S.6-Jun-02 10:28
Haakon S.6-Jun-02 10:28 
GeneralRe: Drawing tool Pin
Paul M Watt6-Jun-02 17:48
mentorPaul M Watt6-Jun-02 17:48 

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.