csharp System.Windows.Forms.ScrollableControl.AutoScroll类(方法)实例源码

下面列出了csharp System.Windows.Forms.ScrollableControl.AutoScroll 类(方法)源码代码实例,从而了解它的用法。

作者:.NET开发    项目:System.Windows.Form   
private void SetAutoScrollMargins()
 {
    /* If the text box is outside the panel's bounds, 
       turn on auto-scrolling and set the margin. */  
    if (text1.Location.X > panel1.Location.X || 
       text1.Location.Y > panel1.Location.Y)
    {
       panel1.AutoScroll = true;
       /* If the AutoScrollMargin is set to less 
          than (5,5), set it to 5,5. */
       if( panel1.AutoScrollMargin.Width < 5 || 
          panel1.AutoScrollMargin.Height < 5)
       {
          panel1.SetAutoScrollMargin(5, 5);
       }
    }
 }


问题


面经


文章

微信
公众号

扫码关注公众号