-3
我有一個孩子的形式,加載在mdi parent.this子表單具有幻燈片效果,當其加載和來自屏幕的左側,並將設置在屏幕的中心(我用一個簡單的定時器做了這個)。滾動條不起作用的Mdi兒童滑動形式
的問題是,如果我不設置窗體的dockstyle
到fill
滾動條不工作,如果我設置dockstyle
到fill
,滑動效果無法正常工作和形式加載簡單!
這是在Form1的按鈕:
Timer timerPrevMonth = new Timer();
//reserve_vaght_azar is the form that will be load in sliding effect
reserve_vaght_azar reservevaghtazar = null;
private void btn_prev_dey_Click(object sender,EventArgs e)
{
reservevaghtazar = new reserve_vaght_azar();
reservevaghtazar.StartPosition = FormStartPosition.Manual;
reservevaghtazar.Location = new Point(this.Location.X-Width,Location.Y);
reservevaghtazar.MdiParent = MdiParent;
this.TopMost = true;
//here is dockstyle
// reservevaghtazar.Dock=DockStyle.Fill;
reservevaghtazar.Show();
timerPrevMonth.Start();
}
這是定時器功能:
void timerPrevMonth_Tick(object sender,EventArgs e)
{
timerPrevMonth.Stop();
reservevaghtazar.Location = new Point(reservevaghtazar.Location.X +15,this.Location.Y);
if (this.Location.X-reservevaghtazar.Location.X <5)
{
reservevaghtazar.Location = new Point(this.Location.X,this.Location.Y);
this.TopMost = false;
reservevaghtazar.BringToFront();
reservevaghtazar.Focus();
}
else
timerPrevMonth.Start();
}
當在Form1按下按鈕,表格reserve_vaght_azar
將負載的滑動效果
請張貼一些代碼重複的問題。 – LarsTech
神祕的問題,表單沒有DockStyle屬性。你到底在說什麼? –
請讓我把一些代碼告訴你 – Arash