Click here to Skip to main content
15,891,529 members
Home / Discussions / Managed C++/CLI
   

Managed C++/CLI

 
AnswerRe: Class Constructor in C++ Pin
Maximilien20-Feb-12 9:43
Maximilien20-Feb-12 9:43 
GeneralRe: Class Constructor in C++ Pin
Lamos Paul20-Feb-12 10:50
Lamos Paul20-Feb-12 10:50 
GeneralRe: Class Constructor in C++ Pin
Richard MacCutchan20-Feb-12 22:11
mveRichard MacCutchan20-Feb-12 22:11 
AnswerRe: Class Constructor in C++ Pin
jschell20-Feb-12 10:29
jschell20-Feb-12 10:29 
QuestionFading a Form Pin
Lucidation18-Feb-12 7:15
Lucidation18-Feb-12 7:15 
AnswerRe: Fading a Form Pin
Philippe Mori18-Feb-12 8:28
Philippe Mori18-Feb-12 8:28 
GeneralRe: Fading a Form Pin
Lucidation18-Feb-12 13:55
Lucidation18-Feb-12 13:55 
AnswerRe: Fading a Form PinPopular
Luc Pattyn18-Feb-12 14:15
sitebuilderLuc Pattyn18-Feb-12 14:15 
There are at least two problems with your code:

1. there is no delay in your loop, it will sprint from 0 to 1 as fast as it can, all will be over in a fraction of a second.

2. the Form isn't visible while the Load handler is executing; it is only when Load is done that the Form becomes visible, so this is the wrong place for such loop.

The recommended solution to both these issues is as follows:
- give your Form an initial opacity of zero;
- in your Load handler, start a Windows.Forms.Timer with an interval of say 100 msec;
- in the timer's Tick handler, check the Form's opacity; if it is less than 1.0, add 0.05 to it; otherwise, stop the timer.

The reason you choose a Windows.Forms.Timer is that its events get handled by the main thread, and that is the only thread that is allowed to touch Controls and Forms. Other timers would tick on some threadpool thread, resulting in either some InvalidCrossThread exception, or the need for more code, based on Control.Invoke

Also notice there is no explicit loop anywhere; the timer will keep firing until you tell it to stop (when opacity reached 1.0).

Smile | :)
Luc Pattyn [My Articles] Nil Volentibus Arduum

QuestionCArchiveException exception is not caught in catch(CArchiveException* e) block Pin
ptr_Electron17-Feb-12 5:21
ptr_Electron17-Feb-12 5:21 
AnswerRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
Mohibur Rashid17-Feb-12 5:51
professionalMohibur Rashid17-Feb-12 5:51 
GeneralRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
ptr_Electron17-Feb-12 20:16
ptr_Electron17-Feb-12 20:16 
AnswerRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
Richard MacCutchan17-Feb-12 6:35
mveRichard MacCutchan17-Feb-12 6:35 
GeneralRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
ptr_Electron17-Feb-12 20:14
ptr_Electron17-Feb-12 20:14 
GeneralRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
Richard MacCutchan17-Feb-12 21:10
mveRichard MacCutchan17-Feb-12 21:10 
GeneralRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
ptr_Electron17-Feb-12 21:29
ptr_Electron17-Feb-12 21:29 
AnswerRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
Luc Pattyn17-Feb-12 6:42
sitebuilderLuc Pattyn17-Feb-12 6:42 
AnswerRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
John Schroedl17-Feb-12 7:37
professionalJohn Schroedl17-Feb-12 7:37 
GeneralRe: CArchiveException exception is not caught in catch(CArchiveException* e) block Pin
Richard MacCutchan17-Feb-12 21:30
mveRichard MacCutchan17-Feb-12 21:30 
QuestionCalling DLL problem Pin
Member 447869216-Feb-12 23:32
Member 447869216-Feb-12 23:32 
QuestionConstructor Pin
Lamos Paul15-Feb-12 13:42
Lamos Paul15-Feb-12 13:42 
AnswerRe: Constructor Pin
Richard Andrew x6415-Feb-12 13:55
professionalRichard Andrew x6415-Feb-12 13:55 
AnswerRe: Constructor Pin
Luc Pattyn20-Feb-12 8:48
sitebuilderLuc Pattyn20-Feb-12 8:48 
Questionerror C2143: syntax error : missing ';' before '*' Pin
Sam Hobbs13-Feb-12 18:56
Sam Hobbs13-Feb-12 18:56 
AnswerRe: error C2143: syntax error : missing ';' before '*' Pin
Richard MacCutchan13-Feb-12 22:34
mveRichard MacCutchan13-Feb-12 22:34 
GeneralRe: error C2143: syntax error : missing ';' before '*' Pin
Sam Hobbs13-Feb-12 23:36
Sam Hobbs13-Feb-12 23:36 

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.