너비를 움직이는 방법을 알려줄 것입니다.
int _collapsedWidth;
int _fullWidth;
float _speed;
float _acurateWidth;
System.Diagnostics.Stopwatch _stopwatch = new Stopwatch();
int _animationDirection;
AnimatedControl(){
Application.Idle += ApplicationIdle;
}
void Expand(){
_animationDirection = 1;
_stopwatch.Start();
}
void ApplicationIdle (object sender, EventArgs e){
if (_animation.Direction == 0)
return;
float delta = _stopwatch.Elapsed.TotalMilliseconds * _speed;
_acurateWidth += delta;
if (_acurateWidth < _collapsedWidth)
{
_animationDirection = 0;
_acurateWidth = _collapsedWidth;
_stopwatch.Stop();
}
else if (_acurateWidth > _fullWidth)
{
_animationDirection = 0;
_acurateWidth = _fullWidth;
_stopwatch.Stop();
}
_stopwatch.Reset();
this.Width = (int)System.Math.Round(_acurateWidth , MidpointRounding.AwayFromZero);
this.Invalidate(); // May not need this
}
과 뭔가를해야만 비슷하지만 translucent images 사용하여 사진에 대한
, 당신은 투명 배경 그들을 위해 색상뿐만 아니라 당신이 일을 칠하는 방법을 따라와 새 컨트롤을 할 수 있습니다.
이 컨트롤을 LayoutPanel
컨트롤 중 하나에 넣으면 폼의 다른 컨트롤을 너비와 일치하도록 이동할 수 있습니다.
답변 주셔서 감사합니다. 아프다면 제가 아프게 작동하도록 할 수 있다면 답을 수락하십시오. – caesay