.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Splash Screen in C#

15 REPLIES 15
Reply
Message 1 of 16
Anonymous
1153 Views, 15 Replies

Splash Screen in C#

Hi everyone!

Is it possible to create possible to create splash screen in C#.
How should i do?

Thanks in advance!
Aymen
15 REPLIES 15
Message 2 of 16
RonnieWilkins
in reply to: Anonymous

http://www.google.com/search?hl=en&q=splash+screen+site%3Awww.codeproject.com
Ronnie Wilkins, Jr.
Message 3 of 16
Anonymous
in reply to: Anonymous

Thanks rwilkins,

The problem is that i have already seen some of these examples. In fact i have to be more precise :
i would like to show my splash screen when the dll is loaded in autocad, i have already created the necesary display functions but i don't know how to implement it. I wonder if there is an equivalent in C# to the C++ void initApp(){}...

Sorry for my english and thanks in advance for anyone who can help.

Aymen,
Message 4 of 16
Anonymous
in reply to: Anonymous

Sorry I meant an equivalent to kInitAppMsg...
Message 5 of 16
Anonymous
in reply to: Anonymous

You could use the IExtensionApplication Interface which is called
when your app is loaded and unloaded. Whether or not this is a
good idea with a timed form is another thing. Maybe someone will
let us know.

wrote in message news:5317804@discussion.autodesk.com...
Thanks rwilkins,

The problem is that i have already seen some of these examples. In fact i
have to be more precise :
i would like to show my splash screen when the dll is loaded in autocad, i
have already created the necesary display functions but i don't know how to
implement it. I wonder if there is an equivalent in C# to the C++ void
initApp(){}...

Sorry for my english and thanks in advance for anyone who can help.

Aymen,
Message 6 of 16
Anonymous
in reply to: Anonymous

Here is a sample of implementing this interface.
Someone please chime in if this is not the right way
to approach this.

[code]
public class LoadUnload : IExtensionApplication
{
#region IExtensionApplication Members

public void Initialize()
{
Application.DocumentManager.MdiActiveDocument.
Editor.WriteMessage("I just loaded");
}

public void Terminate()
{
//no NetUnload
}

#endregion
}
[/code]

"Paul Richardson" wrote in message
news:5317832@discussion.autodesk.com...
You could use the IExtensionApplication Interface which is called
when your app is loaded and unloaded. Whether or not this is a
good idea with a timed form is another thing. Maybe someone will
let us know.

wrote in message news:5317804@discussion.autodesk.com...
Thanks rwilkins,

The problem is that i have already seen some of these examples. In fact i
have to be more precise :
i would like to show my splash screen when the dll is loaded in autocad, i
have already created the necesary display functions but i don't know how to
implement it. I wonder if there is an equivalent in C# to the C++ void
initApp(){}...

Sorry for my english and thanks in advance for anyone who can help.

Aymen,
Message 7 of 16
Anonymous
in reply to: Anonymous

Thanks Paul! It seems to be a good idea, i'm trying it... I'll tell you if it works.

Aymen
Message 8 of 16
Anonymous
in reply to: Anonymous

Quite amazing, I didn't see your last post, I was trying the same code you wrote and... it works for me. Now, I have to find a way to show the splash screen...

Aymen


This is the working code:


using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.GraphicsInterface;


[assembly: CommandClass(typeof(TempProject.SplashScreenProject))]
namespace TempProject
{
public class Class1 : Autodesk.AutoCAD.Runtime.IExtensionApplication
{
#region IExtensionApplication Members
public void Initialize()
{
//Code to run when the program is loaded
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("Loading...Showing a splash screen project");
Application.ShowAlertDialog("Should be a splash sceen instead!");
}

public void Terminate()
{
}
#endregion
}

public class SplashScreenProject
{
[CommandMethod("spl-command")]
static public void splash()
{
Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("\nInvoking a command...");
}

}
}
Message 9 of 16
Anonymous
in reply to: Anonymous

You don't need a command this will be called automatically
when your app is loaded.
I assume just calling your method to show the splash in the
initialize member should do it.

wrote in message news:5317979@discussion.autodesk.com...
Quite amazing, I didn't see your last post, I was trying the same code you
wrote and... it works for me. Now, I have to find a way to show the splash
screen...

Aymen


This is the working code:


using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.GraphicsInterface;


[assembly: CommandClass(typeof(TempProject.SplashScreenProject))]
namespace TempProject
{
public class Class1 : Autodesk.AutoCAD.Runtime.IExtensionApplication
{
#region IExtensionApplication Members
public void Initialize()
{
//Code to run when the program is loaded
Editor ed =
Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("Loading...Showing a splash screen project");
Application.ShowAlertDialog("Should be a splash sceen
instead!");
}

public void Terminate()
{
}
#endregion
}

public class SplashScreenProject
{
[CommandMethod("spl-command")]
static public void splash()
{
Editor ed =
Application.DocumentManager.MdiActiveDocument.Editor;
ed.WriteMessage("\nInvoking a command...");
}

}
}
Message 10 of 16
Anonymous
in reply to: Anonymous

🙂
Yes I know, the command added was only for my personal use... When I said it works I meant that the messageBox appeared in the screen and "Loading...Showing a splash screen project" was displayed in the command line.

Aymen,
Message 11 of 16
Anonymous
in reply to: Anonymous

It was more for any others viewing the post... 🙂
wrote in message news:5318018@discussion.autodesk.com...
:-)
Yes I know, the command added was only for my personal use... When I said it
works I meant that the messageBox appeared in the screen and
"Loading...Showing a splash screen project" was displayed in the command
line.

Aymen,
Message 12 of 16
Anonymous
in reply to: Anonymous

Check out Lab6. There is a sample that does multiple things at startup,
so I guess it's ok. Dump them all into a single file and you have a
nice searchable reference.

"Paul Richardson" wrote in message
news:5318110@discussion.autodesk.com...
It was more for any others viewing the post... 🙂
wrote in message news:5318018@discussion.autodesk.com...
:-)
Yes I know, the command added was only for my personal use... When I said it
works I meant that the messageBox appeared in the screen and
"Loading...Showing a splash screen project" was displayed in the command
line.

Aymen,
Message 13 of 16
Anonymous
in reply to: Anonymous

Thanks Paul!
Ok, this is what i exactly did, it works perfectly. 😉
Now, my problem is that i would like to make my splash screen disappear after 3 seconds...i'm exploring example codes.

Aymen,
Message 14 of 16
Anonymous
in reply to: Anonymous

I found this in the net :
http://arxdummies.blogspot.com/2006/05/transparent-splash-screen.html

it is in C++, i'm trying to understand it...

Aymen,
Message 15 of 16
Anonymous
in reply to: Anonymous

Hi all,
...And the solution was to insert a timer from the toolbox and the code added in the region Windows form would be :

private void InitializeComponent()
{
///some code here
this.timer1 = new System.Windows.Forms.Timer(this.components);
///perhaps some code here
this.timer1.Enabled = true; //acvtivate the timer
this.timer1.Interval = 3000; //setting the event notification interval to 3 seconds
this.timer1.Tick += new System.EventHandler(this.timer1_Tick); //Event handler and associated void

///some code here

}

And the editor will ask you to add this :

void timer1_Tick(object sender, EventArgs e)
{
//The two lines that follow are added by the user
timer1.Stop(); //Stop the timer
this.Close();//Close the form
}

Ok, that's all for today!

I hope that it is enough clear, unfortunately my english doesn't allow me to explain more.
Thank you Paul for your help.

Aymen,
Message 16 of 16
Anonymous
in reply to: Anonymous

check this out.
http://through-the-interface.typepad.com/

wrote in message news:5317104@discussion.autodesk.com...
Hi everyone!

Is it possible to create possible to create splash screen in C#.
How should i do?

Thanks in advance!
Aymen

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost