Click here to Skip to main content
15,911,360 members
Home / Discussions / C#
   

C#

 
GeneralRe: HTML editor in C# Pin
James T. Johnson15-Sep-03 4:26
James T. Johnson15-Sep-03 4:26 
GeneralRe: HTML editor in C# Pin
Jasper4C#15-Sep-03 8:08
Jasper4C#15-Sep-03 8:08 
GeneralMain Form Control Pin
dbetting13-Sep-03 14:17
dbetting13-Sep-03 14:17 
GeneralRe: Main Form Control Pin
mcgahanfl14-Sep-03 14:15
mcgahanfl14-Sep-03 14:15 
GeneralRe: Main Form Control Pin
dbetting14-Sep-03 15:12
dbetting14-Sep-03 15:12 
GeneralRe: Main Form Control Pin
mcgahanfl15-Sep-03 3:03
mcgahanfl15-Sep-03 3:03 
GeneralScreen Coordinates Pin
Paul Silvernail13-Sep-03 7:32
Paul Silvernail13-Sep-03 7:32 
GeneralRe: Screen Coordinates Pin
leppie13-Sep-03 8:12
leppie13-Sep-03 8:12 
GeneralRe: Screen Coordinates Pin
Paul Silvernail13-Sep-03 8:25
Paul Silvernail13-Sep-03 8:25 
GeneralRe: Screen Coordinates Pin
leppie13-Sep-03 8:40
leppie13-Sep-03 8:40 
GeneralRe: Decimal to Binary to Hex convert Pin
eggie513-Sep-03 18:05
eggie513-Sep-03 18:05 
GeneralNamespace 'ADO' not accessible.... Pin
Pranoti13-Sep-03 5:30
Pranoti13-Sep-03 5:30 
GeneralRe: Namespace 'ADO' not accessible.... Pin
dbetting13-Sep-03 15:17
dbetting13-Sep-03 15:17 
GeneralRe: Namespace 'ADO' not accessible.... Pin
Pranoti14-Sep-03 23:18
Pranoti14-Sep-03 23:18 
GeneralRe: Namespace 'ADO' not accessible.... Pin
dbetting15-Sep-03 14:27
dbetting15-Sep-03 14:27 
GeneralUsing a custom icon from resource file Pin
Paul Silvernail13-Sep-03 4:24
Paul Silvernail13-Sep-03 4:24 
GeneralRe: Using a custom icon from resource file Pin
Paul Silvernail13-Sep-03 7:30
Paul Silvernail13-Sep-03 7:30 
GeneralRe: Using a custom icon from resource file Pin
James T. Johnson14-Sep-03 11:10
James T. Johnson14-Sep-03 11:10 
Be careful with code like this:

Paul Silvernail wrote:
private void Form1_Load(object sender, System.EventArgs e)
{
image1 = new Bitmap(GetType(),"icon1.png");
image2 = new Bitmap(GetType(),"icon2.png");
SelectionCursor = new Cursor(GetType(),"Cursor1.cur");

this.pictureBox1.BackgroundImage = image1;
}


If you create a new form which inherits from Form1, but doesn't exist in the same namespace or assembly; the constructors will throw an exception because the resource can't be found. GetType() will return a Type object for the new form, not for Form1 resulting in the exception.

A better way to do it is to use typeof(Form1) so that you will always be referencing the correct Type object.

James

"then when you go to bed...wait, you dont do that do you....ok....when you plug into the 'hive mind' to charge yourself, ill hack into your head"
Nnamdi Onyeyiri over MSN

GeneralFast image adding for ImageList Pin
Jucovschi Petru13-Sep-03 3:55
Jucovschi Petru13-Sep-03 3:55 
GeneralRe: Fast image adding for ImageList Pin
leppie13-Sep-03 4:57
leppie13-Sep-03 4:57 
Generaldebugging in VS stopped working... Pin
Jan R Hansen13-Sep-03 1:19
Jan R Hansen13-Sep-03 1:19 
GeneralRe: debugging in VS stopped working... Pin
Uwe Keim13-Sep-03 2:26
sitebuilderUwe Keim13-Sep-03 2:26 
QuestionWould someone please put me on the right track? Pin
profoundwhispers12-Sep-03 22:53
profoundwhispers12-Sep-03 22:53 
AnswerRe: Would someone please put me on the right track? Pin
J. Dunlap13-Sep-03 9:26
J. Dunlap13-Sep-03 9:26 
Generaldll references Pin
pseudonym6712-Sep-03 22:19
pseudonym6712-Sep-03 22:19 

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.