Click here to Skip to main content
15,849,907 members
Home / Discussions / C#
   

C#

 
QuestionStreamWriter & xml reading problem Pin
Casper Hansen2-Jul-08 10:37
Casper Hansen2-Jul-08 10:37 
AnswerRe: StreamWriter & xml reading problem Pin
Luc Pattyn2-Jul-08 10:52
sitebuilderLuc Pattyn2-Jul-08 10:52 
Questionconvert class into xml schema? [modified] Pin
pankazmittal2-Jul-08 10:25
pankazmittal2-Jul-08 10:25 
AnswerRe: convert class into xml schema? Pin
led mike2-Jul-08 10:33
led mike2-Jul-08 10:33 
AnswerRe: convert class into xml schema? Pin
blackjack21503-Jul-08 0:02
blackjack21503-Jul-08 0:02 
QuestionDeserialize an object and write it to a file Pin
Member 34494422-Jul-08 8:34
Member 34494422-Jul-08 8:34 
AnswerRe: Deserialize an object and write it to a file Pin
leppie2-Jul-08 9:17
leppie2-Jul-08 9:17 
QuestionResizing DateTimePicker to fit max value text Pin
hpjchobbes2-Jul-08 6:42
hpjchobbes2-Jul-08 6:42 
I am creating a ToolStrip that I have a DateTimePicker added on using the following code:
DateTimePicker FromDate = new DateTimePicker();

FromDate.Format = DateTimePickerFormat.Short;

MainToolStrip.Items.Add(new ToolStripControlHost(FromDate));


I am wanting to change the width of the DateTimePicker to be just large enough to fit the text needed. My thought was to measure the MaxDate value string using the font and that would be the width, like so:
Size dtps = TextRenderer.MeasureText(FromDate.MaxDate.ToShortDateString(), FromDate.Font);

FromDate.Size = dtps;


This works, except for one problem, it does not include the width for the drop down button on the DateTimePicker control, so it overlaps the text. I do not know how to get the width of the drop down button on the DateTimePicker, and my searches have been less than successful. Does anyone have a reference to where I can learn how to do this?

Also, is there any good references that go into some of this type of detail? Most of the books and websites I visit will teach you the basics of a control, like how to change the font, width, height, and common properties, but I would like to get a bit deeper with these items and really see what they can do. I think these books might be what I am looking for, but have not got them yet:
'GDI+ Custom Controls with Visual C# 2005' by Tiberiu Radu, Iulian Serban, Dragos Brezoi, Adam Ward
'Pro .NET 2.0 Windows Forms and Custom Controls in C#' by Matthew MacDonald
'Windows Forms 2.0 Programming' by Chris Sells, Michael Weinhardt

Anyone have any experience with these books, or maybe could recommend something similar?

Thanks for your time, in advance! =)
AnswerRe: Resizing DateTimePicker to fit max value text Pin
KaptinKrunch2-Jul-08 7:51
KaptinKrunch2-Jul-08 7:51 
AnswerRe: Resizing DateTimePicker to fit max value text Pin
led mike2-Jul-08 8:15
led mike2-Jul-08 8:15 
QuestionNeed help running Javascript when my toolbar button is clicked [modified] Pin
marc2212-Jul-08 6:30
marc2212-Jul-08 6:30 
AnswerRe: Need help running Javascript when my toolbar button is clicked Pin
benjymous2-Jul-08 23:37
benjymous2-Jul-08 23:37 
GeneralRe: Need help running Javascript when my toolbar button is clicked Pin
marc2213-Jul-08 4:04
marc2213-Jul-08 4:04 
QuestionFileSystemWatcher filter problem and how it works Pin
Xmen Real 2-Jul-08 6:24
professional Xmen Real 2-Jul-08 6:24 
AnswerRe: FileSystemWatcher filter problem and how it works Pin
KaptinKrunch2-Jul-08 7:45
KaptinKrunch2-Jul-08 7:45 
GeneralRe: FileSystemWatcher filter problem and how it works Pin
Xmen Real 2-Jul-08 8:02
professional Xmen Real 2-Jul-08 8:02 
GeneralRe: FileSystemWatcher filter problem and how it works Pin
KaptinKrunch2-Jul-08 8:23
KaptinKrunch2-Jul-08 8:23 
GeneralRe: FileSystemWatcher filter problem and how it works Pin
Xmen Real 2-Jul-08 8:27
professional Xmen Real 2-Jul-08 8:27 
QuestionHow to open a windows form window from an outlook mail Pin
sivasankar anumula2-Jul-08 5:56
sivasankar anumula2-Jul-08 5:56 
RantRe: How to open a windows form window from an outlook mail Pin
Spacix One2-Jul-08 6:03
Spacix One2-Jul-08 6:03 
AnswerRe: How to open a windows form window from an outlook mail Pin
PIEBALDconsult2-Jul-08 6:22
mvePIEBALDconsult2-Jul-08 6:22 
Questionneed answer Pin
Miss_hacker2-Jul-08 4:18
Miss_hacker2-Jul-08 4:18 
AnswerRe: need answer Pin
Simon P Stevens2-Jul-08 5:06
Simon P Stevens2-Jul-08 5:06 
AnswerRe: need answer Pin
KaptinKrunch2-Jul-08 7:55
KaptinKrunch2-Jul-08 7:55 
Questionhow to implement keyboard hotkeys to minimize an application & reopen it? Pin
WebMaster2-Jul-08 4:07
WebMaster2-Jul-08 4:07 

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.