Click here to Skip to main content
15,891,905 members
Home / Discussions / C#
   

C#

 
QuestionStreamWriter & xml reading problem Pin
Casper Hansen2-Jul-08 9:37
Casper Hansen2-Jul-08 9:37 
AnswerRe: StreamWriter & xml reading problem Pin
Luc Pattyn2-Jul-08 9:52
sitebuilderLuc Pattyn2-Jul-08 9:52 
Questionconvert class into xml schema? [modified] Pin
pankazmittal2-Jul-08 9:25
pankazmittal2-Jul-08 9:25 
AnswerRe: convert class into xml schema? Pin
led mike2-Jul-08 9:33
led mike2-Jul-08 9:33 
AnswerRe: convert class into xml schema? Pin
blackjack21502-Jul-08 23:02
blackjack21502-Jul-08 23:02 
QuestionDeserialize an object and write it to a file Pin
Member 34494422-Jul-08 7:34
Member 34494422-Jul-08 7:34 
AnswerRe: Deserialize an object and write it to a file Pin
leppie2-Jul-08 8:17
leppie2-Jul-08 8:17 
QuestionResizing DateTimePicker to fit max value text Pin
hpjchobbes2-Jul-08 5:42
hpjchobbes2-Jul-08 5: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 6:51
KaptinKrunch2-Jul-08 6:51 
AnswerRe: Resizing DateTimePicker to fit max value text Pin
led mike2-Jul-08 7:15
led mike2-Jul-08 7:15 
QuestionNeed help running Javascript when my toolbar button is clicked [modified] Pin
marc2212-Jul-08 5:30
marc2212-Jul-08 5:30 
AnswerRe: Need help running Javascript when my toolbar button is clicked Pin
benjymous2-Jul-08 22:37
benjymous2-Jul-08 22:37 
GeneralRe: Need help running Javascript when my toolbar button is clicked Pin
marc2213-Jul-08 3:04
marc2213-Jul-08 3:04 
QuestionFileSystemWatcher filter problem and how it works Pin
Xmen Real 2-Jul-08 5:24
professional Xmen Real 2-Jul-08 5:24 
AnswerRe: FileSystemWatcher filter problem and how it works Pin
KaptinKrunch2-Jul-08 6:45
KaptinKrunch2-Jul-08 6:45 
GeneralRe: FileSystemWatcher filter problem and how it works Pin
Xmen Real 2-Jul-08 7:02
professional Xmen Real 2-Jul-08 7:02 
GeneralRe: FileSystemWatcher filter problem and how it works Pin
KaptinKrunch2-Jul-08 7:23
KaptinKrunch2-Jul-08 7:23 
GeneralRe: FileSystemWatcher filter problem and how it works Pin
Xmen Real 2-Jul-08 7:27
professional Xmen Real 2-Jul-08 7:27 
QuestionHow to open a windows form window from an outlook mail Pin
sivasankar anumula2-Jul-08 4:56
sivasankar anumula2-Jul-08 4:56 
RantRe: How to open a windows form window from an outlook mail Pin
Spacix One2-Jul-08 5:03
Spacix One2-Jul-08 5:03 
AnswerRe: How to open a windows form window from an outlook mail Pin
PIEBALDconsult2-Jul-08 5:22
mvePIEBALDconsult2-Jul-08 5:22 
Questionneed answer Pin
Miss_hacker2-Jul-08 3:18
Miss_hacker2-Jul-08 3:18 
AnswerRe: need answer Pin
Simon P Stevens2-Jul-08 4:06
Simon P Stevens2-Jul-08 4:06 
AnswerRe: need answer Pin
KaptinKrunch2-Jul-08 6:55
KaptinKrunch2-Jul-08 6:55 
Questionhow to implement keyboard hotkeys to minimize an application & reopen it? Pin
WebMaster2-Jul-08 3:07
WebMaster2-Jul-08 3: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.