Click here to Skip to main content
15,888,521 members
Home / Discussions / C#
   

C#

 
AnswerRe: REfresging Form While process is running Pin
Giorgi Dalakishvili10-Jun-08 0:12
mentorGiorgi Dalakishvili10-Jun-08 0:12 
GeneralRe: REfresging Form While process is running Pin
MumbleB10-Jun-08 1:44
MumbleB10-Jun-08 1:44 
GeneralRe: REfresging Form While process is running Pin
Giorgi Dalakishvili10-Jun-08 1:56
mentorGiorgi Dalakishvili10-Jun-08 1:56 
GeneralRe: REfresging Form While process is running Pin
MumbleB10-Jun-08 5:44
MumbleB10-Jun-08 5:44 
GeneralRe: REfresging Form While process is running [modified] Pin
Giorgi Dalakishvili10-Jun-08 6:03
mentorGiorgi Dalakishvili10-Jun-08 6:03 
GeneralRe: REfresging Form While process is running Pin
MumbleB10-Jun-08 7:07
MumbleB10-Jun-08 7:07 
GeneralRe: REfresging Form While process is running Pin
Giorgi Dalakishvili10-Jun-08 7:35
mentorGiorgi Dalakishvili10-Jun-08 7:35 
QuestionSplash Screen Form Pin
see_seA9-Jun-08 23:57
see_seA9-Jun-08 23:57 
I'm trying to make a splash screen with the following requirements:
1) Must fade in and fade out (issues)
2) Fades in before main program form is open and fades out once it is (done this)
3) Displays an image which is not squash and has transparency (issues)

So I've looked on the net and I'm still struggling with some aspects if anyone can assist. Fading the form is trivial (by setting the Opacity), however getting a form to be transparent (to work with the pictures transparency) and then fading that in and out is a mess.

I have tried numerous methods, such as overriding OnPaintBackground, changing the style of a form to allow a transparent background and a few other things. The problems I hit are:
- When fading the transparent form, by changing the Opacity the transparent bits turn black
- When the splash screen first shows it paints properly, but when the main form is finally loaded the transparent bits of the splash screen still show what was there before the form loaded (i.e. not repainting or something).

At the moment some of the code I have looks like this:
protected override void OnPaint(PaintEventArgs e)
{
    // Do nothing here!
}

protected override void OnPaintBackground(PaintEventArgs e)
{
    Console.WriteLine("paintBackground");
    Graphics gfx = e.Graphics;
    gfx.DrawImage(global::DesktopLiveDotNet.Properties.Resources.splash_screen, new Rectangle(0, 0, Width, Height));
}


But when it starts to fade the transparency turns black:

private void timer1_Tick(object sender, EventArgs e)
{
    Opacity = fOpacity / 100;

    Application.DoEvents();
    fOpacity -= StepVal;

    if (fOpacity <= 0)
    {
        timer1.Stop();
        Close();
    }
}


Not quite sure how to proceed and any ideas would be great! Smile | :)
AnswerRe: Splash Screen Form Pin
leppie10-Jun-08 23:46
leppie10-Jun-08 23:46 
GeneralRe: Splash Screen Form Pin
see_seA11-Jun-08 0:02
see_seA11-Jun-08 0:02 
Questionproblem with output parameter Pin
Mr.Kode9-Jun-08 23:50
Mr.Kode9-Jun-08 23:50 
AnswerRe: problem with output parameter Pin
Ashfield10-Jun-08 1:25
Ashfield10-Jun-08 1:25 
AnswerRe: problem with output parameter Pin
Eslam Afifi10-Jun-08 2:30
Eslam Afifi10-Jun-08 2:30 
QuestionAdding VB Code to ThisWorkbook using C# problem Pin
Yasser Sobhdel9-Jun-08 23:26
Yasser Sobhdel9-Jun-08 23:26 
QuestionByte[] type in datagrid gives error. Pin
topcatalpha9-Jun-08 23:08
topcatalpha9-Jun-08 23:08 
QuestionFetching files Pin
shriya_179-Jun-08 23:04
shriya_179-Jun-08 23:04 
AnswerRe: Fetching files Pin
Ashfield9-Jun-08 23:28
Ashfield9-Jun-08 23:28 
QuestionGet filename from windows explorer right menu? Pin
Abdul Gafoor9-Jun-08 22:39
Abdul Gafoor9-Jun-08 22:39 
AnswerRe: Get filename from windows explorer right menu? Pin
Giorgi Dalakishvili9-Jun-08 22:45
mentorGiorgi Dalakishvili9-Jun-08 22:45 
QuestionMS Office 2007 - Server Requirements Pin
newc19-Jun-08 22:30
newc19-Jun-08 22:30 
AnswerRe: MS Office 2007 - Server Requirements Pin
Mike Dimmick10-Jun-08 2:17
Mike Dimmick10-Jun-08 2:17 
GeneralRe: MS Office 2007 - Server Requirements Pin
newc110-Jun-08 4:24
newc110-Jun-08 4:24 
QuestionDiscarding Keyboard-Events for GUI Pin
J. Holzer9-Jun-08 21:59
J. Holzer9-Jun-08 21:59 
QuestionIE 7 Restart problem in Vista machine Pin
sachinkalse9-Jun-08 21:41
sachinkalse9-Jun-08 21:41 
AnswerRe: IE 7 Restart problem in Vista machine Pin
Gareth H10-Jun-08 1:06
Gareth H10-Jun-08 1:06 

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.