im creating combobox ctrl dynamically Thru code but not from resource...and Pls let me know how can i increase the height of the ctrl based on the font...ie if the font is small ctrl should be small else if the Font is bigger Ctrl should increase....
i used SetFont() the size of the ctrl is increased and the Font of the items in the Dropdownlist was also increased but the selected item font is not changed...
Just set the font size as mentioned below with m_Font as member.
Doing so will increase the height of the combo box according to the font size and font type
To increase the width, you can SetWindowPos or MoveWindow functions .
CDC *pDC = GetDC();
memset(&lFont, 0, sizeof(lFont));
lFont.lfHeight = 34;
lFont.lfWeight = FW_NORMAL;
lFont.lfOutPrecision = OUT_TT_ONLY_PRECIS;
strcpy( lFont.lfFaceName, _T("Lucida Sans Unicode"));
// Set the Font
// Set the specified font for the edit ctrl.
The other thing I would recommend you look at is MapDialogRect[^], so you can use dialog box units, just like you would if you're doing a resource driven layout, and get them transformed to pixels like CreateWindow uses.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[^]
5. repeat 2, 3, 4 for as many pages as necessary
When you are trying to print a text file directly to a printer, there will be no format information such as font, color, etc sent to the printer. The printer will use its default font to print the text file in its natural text flow. The result is not pretty.
Is there any spl reason to use CSingleLock and CDoubleLock objects and give the reference of a sync objects , whereas we can directly lock the resource by using CCriticalSection Lock and UnLock methods...
1.) I see an infinite while loop without any conditional breakage. Why do you need this?
2.) You are calling strlen on a char array without a NULL terminator. You should probably use strcpy instead of memcpy.
but the second "f<<s<<std::endl" can="" not="" write="" database="" to="" the="" 1.txt="" file.<="" blockquote="">
Your second while loop will never be true on the second pass because you are at the end of the file after you write to the file. However if you fix this it will cause an infinite loop. I would suggest that you redesign your logic flow.
Update your code and come back for a second analysis.
1.)This is a part of my code.In my code ,it’s a thread code.So I use an infinite while loop.
2.)you let me use strcpy instead of memcpy ,I have used strcpy instead of memcpy.But I think it’s not the reason that I can’t write the file.
3.) My second while loop is really true on the second pass.
I’m not sure the reason. Before my second while loop, “f.seekg(0, ios::beg)”seek the begin of the file,maybe that’s why I’m not at the end of the file after I write to the file.
Last Visit: 31-Dec-99 18:00 Last Update: 22-Sep-23 15:16