Click here to Skip to main content
11,704,509 members (57,656 online)

Articles by johannesnestler (Tip/Tricks: 9)

Tip/Tricks: 9

RSS Feed
No articles have been posted.
No blogs have been submitted.

Average tips rating: 4.67

Dialogs and Windows
Posted: 1 Jul 2011   Updated: 1 Jul 2011   Views: 4,860   Rating: 4.83/5    Votes: 4   Popularity: 2.89
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Your tip is useful for main forms with no close or cancel button. But most time you will want the "escape-close-form-behaviour" only with dialogs. This is the recommended way to do it: (Now i see Indivara already mentioned it in the comments)using System;using...
Posted: 13 Jan 2012   Updated: 13 Jan 2012   Views: 6,800   Rating: 3.86/5    Votes: 6   Popularity: 3.89
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 0
Nice solution agent154, I'd just suggest to implement it as extension methods for data row: (and I don't liked your "error reporting" with the '0' Value - because '0' could be a valid index). But I have to say, even if you don't have a database behind the datatable you can use sorting (LINQ,...
Programming Tips
Posted: 21 Jul 2010   Updated: 23 Jul 2010   Views: 1,020   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
OriginalGriff has made a nice and small class. But I don't think I would use this code in an application. Most times when I want to know about the inheritance chain of an object is while I'm coding. So a quick and nice (commandline?) tool would be a better fit, I think. The problem with...
Posted: 24 Sep 2010   Updated: 24 Sep 2010   Views: 9,640   Rating: 4.67/5    Votes: 2   Popularity: 1.20
Licence: The Code Project Open License (CPOL)      Bookmarked: 5   Downloaded: 0
Useful function, but I don't see any need for an recursion here. I'd solve it like this:private static Control FindControlParent(Control control, Type type) { Control ctrlParent = control; while((ctrlParent = ctrlParent.Parent) != null) { ...
Posted: 21 Dec 2010   Updated: 21 Dec 2010   Views: 4,280   Rating: 4.67/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
I think your solution is good if I have to control quality, compressionetc.For a fast conversion I do just this.Bitmap bmp = new Bitmap(@"C:\Example.bmp");bmp.Save(@"C:\Example.gif", ImageFormat.Gif);
Posted: 12 Jul 2011   Updated: 12 Jul 2011   Views: 1,940   Rating: 5.00/5    Votes: 2   Popularity: 1.51
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
I think your function is no (theoretical) replacement for the is operator.The is operator takes an object (left) and a type (right) as arguments, not two objects.The is operator considers inheritance. Look at this (executable) example:using System;namespace IsOperatorCheck{ ...
Posted: 27 Nov 2011   Updated: 27 Nov 2011   Views: 4,280   Rating: 5.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 2   Downloaded: 1
I'd like to offer a "funny" alternative by using a dummy TextBox. public static Bitmap GetPlainTextBitmap(string strText, Font font, Color colorBack, Color colorText, Size sizeTargetBitmap) { // Create a dummy TextBox TextBox txDummy = new TextBox(); ...
Posted: 15 Feb 2012   Updated: 15 Feb 2012   Views: 2,080   Rating: 4.00/5    Votes: 1   Popularity: 0.00
Licence: The Code Project Open License (CPOL)      Bookmarked: 0   Downloaded: 0
It's not realy an alternate - but I think it should be mentioned. Most time you have this kind of code during initialization. So why not use this:StatusProgressBar spb = new StatusProgressBar() { IsIndeterminate = false, Visibility = Visibility.Visible, ...
Debug Tips
Posted: 18 Jan 2012   Updated: 18 Jan 2012   Views: 6,260   Rating: 5.00/5    Votes: 3   Popularity: 2.39
Licence: The Code Project Open License (CPOL)      Bookmarked: 1   Downloaded: 0
Very good tip. I just want to mention an alternative - you can just change your project output type to a console application. (You can undo it later if only needed for debugging). So if you started with a Windows Forms project in Visual Studio: Go to project properties/application/ and in the...
No reference articles have been posted.

Austria Austria
No Biography provided

Advertise | Privacy | Mobile
Web03 | 2.8.150819.1 | Last Updated 29 Aug 2015
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid