Click here to Skip to main content
15,925,255 members
Home / Discussions / C#
   

C#

 
Questionneed to insert name in the database using method Pin
Mamphekgo27-Jun-06 20:30
Mamphekgo27-Jun-06 20:30 
AnswerRe: need to insert name in the database using method Pin
led mike27-Jun-06 20:44
led mike27-Jun-06 20:44 
GeneralRe: need to insert name in the database using method Pin
Mamphekgo27-Jun-06 21:12
Mamphekgo27-Jun-06 21:12 
GeneralRe: need to insert name in the database using method Pin
Mairaaj Khan27-Jun-06 22:32
professionalMairaaj Khan27-Jun-06 22:32 
GeneralRe: need to insert name in the database using method Pin
Michael P Butler28-Jun-06 1:56
Michael P Butler28-Jun-06 1:56 
GeneralRe: need to insert name in the database using method Pin
Mairaaj Khan28-Jun-06 3:33
professionalMairaaj Khan28-Jun-06 3:33 
QuestionMoving Toolstrip Like Toolstrip in MS Products Pin
praveenqwe27-Jun-06 20:12
praveenqwe27-Jun-06 20:12 
Questionpplication.SetCompatibleTextRenderingDefault(false); problem Pin
AngryC27-Jun-06 19:48
AngryC27-Jun-06 19:48 
Hello,

I'm getting the following exception when I'm running my app:

SetCompatibleTextRenderingDefault must be called before the first IWin32Window object is created in the application.

I followed I tutorial to create a splash screen and my Program.cs file has been changed to:

static class Program
{
private static ApplicationContext context;
private static SplashForm sForm = new SplashForm();
private static MainForm mForm = new MainForm();

/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);

context = new ApplicationContext();
Application.Idle += new EventHandler(OnAppIdle);
sForm.Show();
Application.Run(context);
}

private static void OnAppIdle(object sender, EventArgs e)
{
if (context.MainForm == null)
{
Application.Idle -= new EventHandler(OnAppIdle);
mForm.PreLoad();
context.MainForm = mForm;
context.MainForm.Show();
sForm.Close();
sForm = null;
}
}
}

Everything is working fine, except when I uncomment this line:

Application.SetCompatibleTextRenderingDefault(false);

I get the exception mentioned above.

How can I solve that?

Thanks in advance.
AnswerRe: pplication.SetCompatibleTextRenderingDefault(false); problem Pin
led mike27-Jun-06 20:49
led mike27-Jun-06 20:49 
GeneralRe: pplication.SetCompatibleTextRenderingDefault(false); problem Pin
AngryC27-Jun-06 21:04
AngryC27-Jun-06 21:04 
QuestionValue Types and Structs Pin
Mairaaj Khan27-Jun-06 19:48
professionalMairaaj Khan27-Jun-06 19:48 
AnswerRe: Value Types and Structs Pin
Christian Graus27-Jun-06 20:15
protectorChristian Graus27-Jun-06 20:15 
AnswerRe: Value Types and Structs Pin
J4amieC27-Jun-06 21:59
J4amieC27-Jun-06 21:59 
GeneralRe: Value Types and Structs Pin
Mairaaj Khan28-Jun-06 3:53
professionalMairaaj Khan28-Jun-06 3:53 
GeneralRe: Value Types and Structs Pin
BoneSoft28-Jun-06 10:20
BoneSoft28-Jun-06 10:20 
GeneralRe: Value Types and Structs Pin
Mairaaj Khan28-Jun-06 20:42
professionalMairaaj Khan28-Jun-06 20:42 
GeneralRe: Value Types and Structs [modified] Pin
BoneSoft29-Jun-06 1:37
BoneSoft29-Jun-06 1:37 
Questionmonthcalendar control Pin
toink toink27-Jun-06 17:49
toink toink27-Jun-06 17:49 
QuestionHow to read a binary file created in pure c++ Pin
Nigor27-Jun-06 17:45
Nigor27-Jun-06 17:45 
AnswerRe: How to read a binary file created in pure c++ [modified] Pin
Judah Gabriel Himango27-Jun-06 18:00
sponsorJudah Gabriel Himango27-Jun-06 18:00 
AnswerRe: How to read a binary file created in pure c++ [modified] Pin
stancrm27-Jun-06 20:54
stancrm27-Jun-06 20:54 
GeneralRe: How to read a binary file created in pure c++ Pin
paulcortez27-Jun-06 21:59
paulcortez27-Jun-06 21:59 
GeneralRe: How to read a binary file created in pure c++ Pin
stancrm28-Jun-06 1:22
stancrm28-Jun-06 1:22 
GeneralRe: How to read a binary file created in pure c++ Pin
paulcortez28-Jun-06 1:44
paulcortez28-Jun-06 1:44 
GeneralRe: How to read a binary file created in pure c++ Pin
stancrm28-Jun-06 1:51
stancrm28-Jun-06 1:51 

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.