Click here to Skip to main content
15,887,027 members
Home / Discussions / C#
   

C#

 
AnswerRe: C# Memory Leak Question Pin
jschell10-Apr-15 11:36
jschell10-Apr-15 11:36 
GeneralRe: C# Memory Leak Question Pin
Kevin Marois13-Apr-15 3:13
professionalKevin Marois13-Apr-15 3:13 
QuestionEasy Way to Display Multilingual Tooltip and Message Box Pin
Felix Obere10-Apr-15 10:03
Felix Obere10-Apr-15 10:03 
Questionconvert piece of code from C++ to C# Pin
MrKBA10-Apr-15 8:25
MrKBA10-Apr-15 8:25 
AnswerRe: convert piece of code from C++ to C# Pin
RedDk12-Apr-15 16:49
RedDk12-Apr-15 16:49 
Questionsingle quote inside double quote in C# ASP.NET Pin
Rajeshkunwar2510-Apr-15 3:42
Rajeshkunwar2510-Apr-15 3:42 
AnswerRe: single quote inside double quote in C# ASP.NET Pin
OriginalGriff10-Apr-15 3:57
mveOriginalGriff10-Apr-15 3:57 
QuestionI can't get my splash screen to close Pin
jkirkerx9-Apr-15 11:00
professionaljkirkerx9-Apr-15 11:00 
I'm underwater on this

I used this tutorial
A Pretty Good Splash Screen in C#[^]

In the CloseForm, the Splash screen doesn't fade out, or just close and go away
hmm? In VB, you just add it, and it works. I'm stumped here.

So in my FormSplash I wrote [partial example]
public FormSplash()
{
  InitializeComponent();
  this.Text = String.Format("About {0}", AssemblyTitle);
  this.ApplicationTitle.Text = AssemblyProduct;
  this.Version.Text = String.Format("Version {0}", AssemblyVersion);
  this.Copyright.Text = AssemblyCopyright;
}

static public void ShowSplashScreen()
{
  // Make sure it's only launched once.
  if (ms_frmSplash != null)
    return;
  ms_oThread = new Thread(new ThreadStart(FormSplash.ShowForm));
  ms_oThread.IsBackground = true;
  ms_oThread.SetApartmentState(ApartmentState.STA);
  ms_oThread.Start();
  while (ms_frmSplash == null || ms_frmSplash.IsHandleCreated == false)
  {
    System.Threading.Thread.Sleep(TIMER_INTERVAL);<br />
  }
}

static public void ShowForm()
{
   ms_frmSplash = new FormSplash();
   Application.Run(ms_frmSplash);<br />
}

// Close the form without setting the parent.
static public void CloseForm()
{
  if (ms_frmSplash != null && ms_frmSplash.IsDisposed == false)
  {
    // Make it start going away. - I want to use ms_frmSplash.Close, but I get a object error
    ms_frmSplash.m_dblOpacityIncrement = -ms_frmSplash.m_dblOpacityDecrement; // I can't see this working
  }
  ms_oThread = null;  // we don't need these any more.
  ms_frmSplash = null;
}    

And in my program.cs I wrote
[STAThread]
static void Main()
{
  Application.EnableVisualStyles();
  Application.SetCompatibleTextRenderingDefault(false);

  FormSplash.ShowSplashScreen();
  FormSplash.CloseForm();
  Application.Run(new FormMain());      

}   

AnswerRe: I can't get my splash screen to close Pin
Herman<T>.Instance9-Apr-15 23:54
Herman<T>.Instance9-Apr-15 23:54 
GeneralRe: I can't get my splash screen to close Pin
jkirkerx10-Apr-15 6:25
professionaljkirkerx10-Apr-15 6:25 
AnswerRe: I can't get my splash screen to close Pin
Richard MacCutchan10-Apr-15 2:20
mveRichard MacCutchan10-Apr-15 2:20 
GeneralRe: I can't get my splash screen to close Pin
jkirkerx10-Apr-15 6:46
professionaljkirkerx10-Apr-15 6:46 
GeneralRe: I can't get my splash screen to close Pin
Richard MacCutchan10-Apr-15 6:50
mveRichard MacCutchan10-Apr-15 6:50 
GeneralRe: I can't get my splash screen to close Pin
jkirkerx10-Apr-15 7:38
professionaljkirkerx10-Apr-15 7:38 
QuestionApplication.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx9-Apr-15 7:02
professionaljkirkerx9-Apr-15 7:02 
AnswerRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
Richard Deeming9-Apr-15 7:05
mveRichard Deeming9-Apr-15 7:05 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx9-Apr-15 7:24
professionaljkirkerx9-Apr-15 7:24 
AnswerRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
OriginalGriff9-Apr-15 21:47
mveOriginalGriff9-Apr-15 21:47 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx10-Apr-15 6:24
professionaljkirkerx10-Apr-15 6:24 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
OriginalGriff10-Apr-15 6:32
mveOriginalGriff10-Apr-15 6:32 
GeneralRe: Application.Run(new FormMain()); does not contain a constructor that takes 0 arguments Pin
jkirkerx10-Apr-15 7:36
professionaljkirkerx10-Apr-15 7:36 
QuestionParse XML Sibling Pin
antrock1019-Apr-15 6:23
antrock1019-Apr-15 6:23 
AnswerRe: Parse XML Sibling Pin
Richard Deeming9-Apr-15 6:39
mveRichard Deeming9-Apr-15 6:39 
GeneralRe: Parse XML Sibling Pin
antrock1019-Apr-15 9:22
antrock1019-Apr-15 9:22 
GeneralRe: Parse XML Sibling Pin
Richard Deeming9-Apr-15 10:02
mveRichard Deeming9-Apr-15 10:02 

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.