WinForm 창 페이드 효과 인터페이스의 간단한 실현 방법
1639 단어 WinForm
먼저 WinForm 창에서 Timer 컨트롤을 드래그한 다음 Timer 컨트롤의 Tick 이벤트에 다음 코드를 추가합니다.
private void timer1_Tick(object sender, EventArgs e)
{
if (this.Opacity < 1)
{
this.Opacity = this.Opacity + 0.08;
}
else
{
this.timer1.Enabled = false;
}
}
Form 창의 Load 이벤트에서 Opacity 속성의 초기 값을 0으로 설정합니다.
private void Form1_Load(object sender, EventArgs e)
{
this.timer1.Enabled = true;
this.Opacity = 0;
}
이렇게 간단한 페이드 효과를 실현할 수 있다
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
C# Excel 템플릿 내보내기(Word 등)프로젝트에서 Excel, Word, pdf 등 템플릿 내보내기를 자주 사용해야 합니다. 다음은 자신이 정리한 간단한 버전의 템플릿 내보내기입니다. 복잡한 내보내기와 유사합니다. 조금만 수정하면 됩니다.다음 내보내기 ...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.