​C# WinForm panel 顯示 scrollbar

​C# WinForm panel 顯示 scrollbar

C# WinForm panel 顯示 scrollbar


資料來源: https://stackoverflow.com/questions/6090558/add-vertical-scroll-bar-to-panel

https://dotblogs.com.tw/superpapa/2014/02/05/142792


code

//AutoScrollMinSize > Size Scroll 才會出現
this.panelEx1.AutoScroll = true;
this.panelEx1.AutoScrollMinSize = new System.Drawing.Size(0, 1000);//可以事後指定修改
this.panelEx1.Size = new System.Drawing.Size(524, 613);


2 thoughts on “​C# WinForm panel 顯示 scrollbar

  1. 動態變大


    public int m_AddHeight = 0;
    private void panelEx1_Click(object sender, EventArgs e)
    {
    this.panelEx1.AutoScrollMinSize = new System.Drawing.Size(0, 1000+ m_AddHeight);
    m_AddHeight += 200;
    }

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *