View previous topic :: View next topic |
Author |
Message |
un_guru
Joined: 14 Sep 2005 Posts: 32
|
Posted: Tue Feb 14, 2006 9:04 am Post subject: Splash screen |
|
|
hi,
how can I add a splash screen to a DFL application?
thanks |
|
Back to top |
|
|
Chris Miller
Joined: 27 Mar 2004 Posts: 514 Location: The Internet
|
Posted: Tue Feb 14, 2006 10:39 am Post subject: Re: Splash screen |
|
|
Create a new Form with its formBorderStyle set to FormBorderStyle.NONE, put a PictureBox on it, and use a timer to auto-hide it. Here's a quick example:
Code: | /*
Generated by Entice Designer 0.7.1
Entice Designer written by Christopher E. Miller
www.dprogramming.com/entice.php
This source code is public domain.
*/
private import dfl.all, dfl.winapi;
const WORD IDB_SPLASH = 4000;
class SplashForm: dfl.form.Form
{
// Do not modify or move this block of variables.
//~Entice Designer variables begin here.
dfl.picturebox.PictureBox splashPic;
//~Entice Designer variables end here.
Timer delayCloseTimer;
this()
{
initializeSplashForm();
//splashPic.image = new Picture("foo.jpg"); // See http://wiki.dprogramming.com/DflDoc/PictureFormats
//splashPic.image = new Bitmap("foo.bmp");
splashPic.image = new Bitmap(cast(HBITMAP)LoadImageA(Application.getInstance(),
cast(LPCSTR)IDB_SPLASH, IMAGE_BITMAP, 400, 300, 0));
with(delayCloseTimer = new Timer)
{
tick ~= &delayCloseTimer_tick;
interval = 5000; // After 5 secs.
start();
}
}
private void delayCloseTimer_tick(Object sender, EventArgs ea)
{
delayCloseTimer.stop();
this.dispose(); // Dispose of splash screen.
}
private void initializeSplashForm()
{
// Do not manually edit this block of code.
//~Entice Designer 0.7.1 code begins here.
//~DFL Form
formBorderStyle = dfl.form.FormBorderStyle.NONE;
startPosition = dfl.form.FormStartPosition.CENTER_SCREEN;
clientSize = dfl.drawing.Size(400, 300);
//~DFL dfl.picturebox.PictureBox=splashPic
splashPic = new dfl.picturebox.PictureBox();
splashPic.name = "splashPic";
splashPic.bounds = dfl.base.Rect(0, 0, 400, 300);
splashPic.dock = dfl.control.DockStyle.FILL;
splashPic.parent = this;
//~Entice Designer 0.7.1 code ends here.
}
}
|
|
|
Back to top |
|
|
un_guru
Joined: 14 Sep 2005 Posts: 32
|
Posted: Tue Feb 14, 2006 11:40 am Post subject: |
|
|
timer ... nice
I tried sleep(x); ...but it it just sleeps
it's working ok, now I'm waiting for the progressbar control for my application to be complete
thanks again |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|