9 Replies - 2067 Views - Last Post: 03 April 2009 - 03:54 PM Rate Topic: -----

#1 lithomander  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 23-February 09

splash screen

Posted 01 April 2009 - 08:32 AM

im trying to make a splash screen appear before the actual program, i have a time on the program to make it stay for approximatly 5 seconds. i understand that i need to put some code into the program.cs file that looks something like this:

   SplashForm aSplashForm = Form2();
			Form2.ShowDialog();


c# doesnt like it though any advice?

This post has been edited by lithomander: 01 April 2009 - 08:33 AM

Is This A Good Question/Topic? 0
  • +

Replies To: splash screen

#2 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: splash screen

Posted 01 April 2009 - 08:37 AM

how about...

SplashForm aSplashForm = new SplashForm();
aSplashForm.ShowDialog();



you need to create an instance of the form before you try to show it. Also, your syntax was incorrect.
Was This Post Helpful? 0
  • +
  • -

#3 lithomander  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 23-February 09

Re: splash screen

Posted 01 April 2009 - 08:40 AM

i have a from that i would like to use as the splash form.

how do i make an instance for it though?
Was This Post Helpful? 0
  • +
  • -

#4 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: splash screen

Posted 01 April 2009 - 08:48 AM

View Postlithomander, on 1 Apr, 2009 - 10:40 AM, said:

i have a from that i would like to use as the splash form.

how do i make an instance for it though?


what is the name of the form?
Was This Post Helpful? 0
  • +
  • -

#5 lithomander  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 23-February 09

Re: splash screen

Posted 01 April 2009 - 10:06 AM

form2 i think, i dont normally rename the forms
Was This Post Helpful? 0
  • +
  • -

#6 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: splash screen

Posted 01 April 2009 - 10:17 AM

View Postlithomander, on 1 Apr, 2009 - 12:06 PM, said:

form2 i think, i dont normally rename the forms


start now. Rename forms to a meaningful name.

Take "Form2" and rename it to "frmMySplashForm".

then your code will be...

frmMySplashForm sf = new frmMySplashForm();
sf.ShowDialog();


Was This Post Helpful? 1
  • +
  • -

#7 lithomander  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 47
  • Joined: 23-February 09

Re: splash screen

Posted 01 April 2009 - 10:22 AM

thank you for the advice i'll remember to rename everything from now on.
Was This Post Helpful? 0
  • +
  • -

#8 eclipsed4utoo  Icon User is offline

  • Not Your Ordinary Programmer
  • member icon

Reputation: 1524
  • View blog
  • Posts: 5,960
  • Joined: 21-March 08

Re: splash screen

Posted 01 April 2009 - 10:27 AM

View Postlithomander, on 1 Apr, 2009 - 12:22 PM, said:

thank you for the advice i'll remember to rename everything from now on.


you don't really have to rename everything. Just things that you are going to use in code. If you are reading data from a textbox, you should give it a meaningful name. If you have a button, it should have a meaningful name.

if you have a label that serves no other purpose than to display static text, then there is no reason to name it....though you can if you want.
Was This Post Helpful? 0
  • +
  • -

#9 Amrykid  Icon User is offline

  • 4+1=Moo
  • member icon

Reputation: 148
  • View blog
  • Posts: 1,589
  • Joined: 16-December 08

Re: splash screen

Posted 01 April 2009 - 03:25 PM

the way i did it was....i would call/show the form at the beginning of the Main forms's InitializeComponent() and at the end of it....i would close the splash..
Was This Post Helpful? 0
  • +
  • -

#10 X@MPP  Icon User is offline

  • 僕わ馬鹿ですね?
  • member icon

Reputation: 36
  • View blog
  • Posts: 1,014
  • Joined: 20-February 09

Re: splash screen

Posted 03 April 2009 - 03:54 PM

this might help :D http://www.dreaminco...wtopic92856.htm
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1