• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Forms.ScrollableControl类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中System.Windows.Forms.ScrollableControl的典型用法代码示例。如果您正苦于以下问题:C# ScrollableControl类的具体用法?C# ScrollableControl怎么用?C# ScrollableControl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ScrollableControl类属于System.Windows.Forms命名空间,在下文中一共展示了ScrollableControl类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Apply

        public override Rectangle Apply( ScrollableControl control, Size sizeToShow)
        {
            control.AutoScroll = false;

            control.Invalidate();
            return CalcFitRectangle( control.ClientSize, sizeToShow);
        }
开发者ID:yinghau76,项目名称:pviewer,代码行数:7,代码来源:SizeMode.cs


示例2: CreerDesControles

        /// <summary>
        /// Cette méthode crée des controles de type chckbox ou radio button dans un controle de type panel.
        /// Elle va chercher les données dans la base de données et crée autant de controles (les uns au dessous des autres
        /// qu'il y a de lignes renvoyées par la base de données.
        /// </summary>
        /// <param name="UneForme">Le formulaire concerné</param> 
        /// <param name="UneConnexion">L'objet connexion à utiliser pour la connexion à la BD</param> 
        /// <param name="pUneTable">Le nom de la source de données qui va fournir les données. Il s'agit en fait d'une vue de type
        /// VXXXXOn ou XXXX représente le nom de la tabl à partir de laquelle la vue est créée. n représente un numéro de séquence</param>  
        /// <param name="pPrefixe">les noms des controles sont standard : NomControle_XX
        ///                                         ou XX estl'id de l'enregistrement récupéré dans la vue qui
        ///                                         sert de source de données</param>
        /// <param name="UnPanel">panel ou groupbox dans lequel on va créer les controles</param>
        /// <param name="unTypeControle">type de controle à créer : checkbox ou radiobutton</param>
        /// <param name="callback"> Le pointeur de fonction. En fait le pointeur sur la fonction qui réagira à l'événement déclencheur </param>
        public static void CreerDesControles(Form UneForme, Bdd UneConnexion, String pUneTable, String pPrefixe, ScrollableControl UnPanel, String unTypeControle, Action<object, EventArgs> callback)
        {
            DataTable UneTable = UneConnexion.ObtenirDonnesOracle(pUneTable);
            // on va récupérer les statuts dans un datatable puis on va parcourir les lignes(rows) de ce datatable pour
            // construire dynamiquement les boutons radio pour le statut de l'intervenant dans son atelier

            Int16 i = 0;
            foreach (DataRow UneLigne in UneTable.Rows)
            {
                //object UnControle = Activator.CreateInstance(object unobjet, unTypeControle);
                //UnControle=Convert.ChangeType(UnControle, TypeC);

                if (unTypeControle == "CheckBox")
                {
                    CheckBox UnControle = new CheckBox();
                    AffecterControle(UneForme, UnPanel, UnControle, pPrefixe, UneLigne, i++, callback);

                }
                else if (unTypeControle == "RadioButton")
                {
                    RadioButton UnControle = new RadioButton();
                    AffecterControle(UneForme, UnPanel, UnControle, pPrefixe, UneLigne, i++, callback);
                    UnControle.CheckedChanged += new System.EventHandler(callback);
                }
                i++;
            }
            UnPanel.Height = 20 * i + 5;
        }
开发者ID:G-Youssef,项目名称:MaisonDesLigues,代码行数:43,代码来源:Utilitaire.cs


示例3: PropertyEnabled

		public void PropertyEnabled ()
		{
			ScrollableControl sc = new ScrollableControl ();
			ScrollProperties sp = sc.HorizontalScroll;

			sp.Enabled = false;
			Assert.AreEqual (false, sp.Enabled, "B1");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:HScrollPropertiesTest.cs


示例4: InitializeWatchWindow

 public override Control InitializeWatchWindow()
 {
     _pnlMemory = new DoubleBufferedPanel();
     _pnlMemory.Paint += paintMemoryPanel;
     _scroll = new ScrollableControl { Dock = DockStyle.Fill, AutoScroll = true };
     _scroll.Controls.Add(_pnlMemory);
     return _scroll;
 }
开发者ID:Timwi,项目名称:EsotericIDE,代码行数:8,代码来源:Environment.cs


示例5: PropertyLargeChange

		public void PropertyLargeChange ()
		{
			ScrollableControl sc = new ScrollableControl ();
			ScrollProperties sp = sc.HorizontalScroll;

			sp.LargeChange = 25;
			Assert.AreEqual (25, sp.LargeChange, "B1");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:HScrollPropertiesTest.cs


示例6: PropertyMaximum

		public void PropertyMaximum ()
		{
			ScrollableControl sc = new ScrollableControl ();
			ScrollProperties sp = sc.HorizontalScroll;

			sp.Maximum = 200;
			Assert.AreEqual (200, sp.Maximum, "B1");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:8,代码来源:HScrollPropertiesTest.cs


示例7: Phone

 /// <summary>
 /// Creates a new instance of phone.
 /// </summary>
 /// <param name="location">The location of the phone.</param>
 /// <param name="panel">The place to add the phone.</param>
 public Phone(Point location, ScrollableControl control, Random r)
     : base(location, new Size (99, 178), Resources.phone, control)
 {
     timer.Stop ();
     random = r;
     vanishTimer = new TickOnceTimer (random.Next (700, 1700), vanishTimerTick);
     timer.Interval = random.Next (1000, 3000);
     picture.Click += pictureClick;
 }
开发者ID:Sweeper777,项目名称:Whack-an-Android--Windows-Forms-,代码行数:14,代码来源:Phone.cs


示例8: CreerCombo

 /// <summary>
 /// Créé une combobox dans un container avec le nom passé en paramètre
 /// </summary>
 /// <param name="UnContainer">panel ou groupbox</param> 
 /// <param name="unNom">nom de la groupbox à créer</param> 
 /// <param name="UnTop">positionnement haut dans le container  </param> 
 /// <param name="UnLeft">positionnement bas dans le container </param> 
 public static void CreerCombo(ScrollableControl UnContainer, String unNom, Int16 UnTop, Int16 UnLeft)
 {
     CheckBox UneCheckBox= new CheckBox();
     UneCheckBox.Name=unNom;
     UneCheckBox.Top=UnTop;
     UneCheckBox.Left=UnLeft;
     UneCheckBox.Visible=true;
     UnContainer.Controls.Add(UneCheckBox);
 }
开发者ID:Brendaa-B,项目名称:MaisonDesLigues,代码行数:16,代码来源:Utilitaire.cs


示例9: ControlPanel

 public ControlPanel(ScrollableControl parent)
 {
     initialize(parent);
     parent.Controls.Add(panel);
     panel.BackColor = Color.Blue;
     Label ddd = new Label();
     ddd.Text = "--------------------------------";
     panel.Controls.Add(ddd);
 }
开发者ID:helloxyz,项目名称:PostingRobot,代码行数:9,代码来源:ControlPanel.cs


示例10: ToolBarManager

 public ToolBarManager(ScrollableControl dockStation, Form mainForm)
 {
     this.DockStation = dockStation;
     this.MainForm = mainForm;
     _left = new ToolBarDockArea(this, DockStyle.Left);
     _right = new ToolBarDockArea(this, DockStyle.Right);
     _top = new ToolBarDockArea(this, DockStyle.Top);
     _bottom = new ToolBarDockArea(this, DockStyle.Bottom);
     Application.AddMessageFilter(this);
 }
开发者ID:chinasio,项目名称:Control,代码行数:10,代码来源:ToolBarManager.cs


示例11: CreerComposantVac

 public static void CreerComposantVac(ScrollableControl UnContainer, String unNom, Int16 UnTop)
 {
     ComposantPPE.ComposantPPE CP = new ComposantPPE.ComposantPPE();
     CP.Name = unNom;
     CP.Top = UnTop;
     CP.Left = 8;
     CP.Width = 326;
     CP.Height= 21;
     CP.Visible = true;
     UnContainer.Controls.Add(CP);
 }
开发者ID:G-Youssef,项目名称:MaisonDesLigues,代码行数:11,代码来源:Utilitaire.cs


示例12: ControlMoveResize

 /// <summary>
 /// 获取被移动控件对象和容器对象
 /// </summary>
 /// <param name="c">被设置为可运行时移动的控件</param>
 /// <param name="parentContain">可移动控件的容器</param>
 public ControlMoveResize(Control c, ScrollableControl parentContain)
 {
     ctrl = c;
     this.Containe = parentContain;
     //ctrl.MouseDown += new MouseEventHandler(MouseDown);
     //ctrl.MouseMove += new MouseEventHandler(MouseMove);
     //ctrl.MouseUp += new MouseEventHandler(MouseUp);
     ctrl.MouseDown += new MouseEventHandler(MouseDown);
     ctrl.MouseMove += new MouseEventHandler(MouseMove);
     ctrl.MouseUp += new MouseEventHandler(MouseUp);
 }
开发者ID:Chengxiaozhi,项目名称:BjutWork-GunArk,代码行数:16,代码来源:ControlMoveResize.cs


示例13: Caret

        public Caret(ScrollableControl owner)
        {
            this.owner=owner;
            timer=new Timer();
            timer.Tick+=new EventHandler(Toggle);
            timer.Interval=500;
            timer.Enabled=true;

            owner.LostFocus+=new EventHandler(LeaveControl);
            owner.GotFocus+=new EventHandler(EnterControl);
            owner.Paint+=new PaintEventHandler(PaintComplete);
        }
开发者ID:jugglingcats,项目名称:XEditNet,代码行数:12,代码来源:Caret.cs


示例14: Constructor

		public void Constructor ()
		{
			ScrollableControl sc = new ScrollableControl ();
			ScrollProperties sp = sc.HorizontalScroll;

			Assert.AreEqual (true, sp.Enabled, "A1");
			Assert.AreEqual (10, sp.LargeChange, "A2");
			Assert.AreEqual (100, sp.Maximum, "A3");
			Assert.AreEqual (0, sp.Minimum, "A4");
			Assert.AreEqual (1, sp.SmallChange, "A5");
			Assert.AreEqual (0, sp.Value, "A6");
			Assert.AreEqual (false, sp.Visible, "A7");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:13,代码来源:HScrollPropertiesTest.cs


示例15: SimpleCheckRadioList

        public SimpleCheckRadioList()
        {
            _Scroller = new ScrollableControl();

            _Scroller.AutoScroll = true;

            this.Controls.Add(_Scroller);

            _Scroller.Dock = DockStyle.Fill;

            _FlowPanel = new FlowLayoutPanel();

            _FlowPanel.AutoSize = true;

            _FlowPanel.FlowDirection = FlowDirection.TopDown;

            _Scroller.Controls.Add(_FlowPanel);

            this.BackColor = Color.White;
        }
开发者ID:itsbth,项目名称:GLuaR,代码行数:20,代码来源:SimpleCheckRadioList.cs


示例16: VScrollProperties

 /// <include file='doc\VScrollProperties.uex' path='docs/doc[@for="ScrollProperties.VScrollProperties"]/*' />
 public VScrollProperties(ScrollableControl container) : base(container) {
 }
开发者ID:nlh774,项目名称:DotNetReferenceSource,代码行数:3,代码来源:VScrollProperties.cs


示例17: Padding

		public void Padding ()
		{
			ScrollableControl c = new ScrollableControl ();
			c.Dock = DockStyle.Fill;
			c.Padding = new Padding (40);

			Assert.AreEqual (40, c.Padding.All, "A1");
			Assert.AreEqual (40, c.DockPadding.All, "A2");
			
			c.DockPadding.Right = 20;

			Assert.AreEqual (20, c.Padding.Right, "A3");
			Assert.AreEqual (20, c.DockPadding.Right, "A4");
			
			c.Padding = new Padding (40, 40, 40, 40);

			Assert.AreEqual (40, c.Padding.Right, "A5");
			Assert.AreEqual (40, c.DockPadding.Right, "A6");
			
			Form f = new Form ();
			f.Controls.Add (c);
			
			Button b = new Button ();
			c.Controls.Add (b);
			
			f.Show ();
			
			// Padding does not affect laying out the controls
			Assert.AreEqual (new Point (0, 0), b.Location, "A7");
			
			f.Close ();
			f.Dispose ();
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:33,代码来源:ScrollableControlTest.cs


示例18: AutoScrollPositionTest

		public void AutoScrollPositionTest ()
		{
			ScrollableControl sc;

			sc = new ScrollableControl ();
			sc.AutoScroll = true;
			
			sc.AutoScrollPosition = new Point (-25, -50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#01");

			sc.AutoScrollPosition = new Point (2500, 5000);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#02");
			
			sc.AutoScrollPosition = new Point (25, 50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#03");
			
			object o = sc.Handle;

			sc.AutoScrollPosition = new Point (-25, -50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#04");

			sc.AutoScrollPosition = new Point (2500, 5000);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#05");

			sc.AutoScrollPosition = new Point (25, 50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#06");
			
			sc.Size = new Size (200, 400);
			sc.Location = new Point (20, 40);

			sc.AutoScrollPosition = new Point (-25, -50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#07");

			sc.AutoScrollPosition = new Point (2500, 5000);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#08");

			sc.AutoScrollPosition = new Point (25, 50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#09");
			
			
			Control c1, c2;
			c1 = new Control ();
			c1.Location = new Point (-100, -200);
			c1.Size = new Size (10, 10);
			sc.Controls.Add (c1);

			c2 = new Control ();
			c2.Location = new Point (400, 800);
			c2.Size = new Size (10, 10);
			sc.Controls.Add (c2);

			Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#10");
			
			sc.ScrollControlIntoView (c2);

			Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#11");
			Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#12");
			Assert.AreEqual (new Point (-326, -626), c1.Location, "#13");
			Assert.AreEqual (new Point (174, 374), c2.Location, "#14");
			
			sc.AutoScrollPosition = new Point (-25, -50);
			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#01");
			Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#15");
			Assert.AreEqual (new Point (-100, -200), c1.Location, "#16");
			Assert.AreEqual (new Point (400, 800), c2.Location, "#17");

			sc.AutoScrollPosition = new Point (2500, 5000);
			Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#18");
			Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#19");
			Assert.AreEqual (new Point (-326, -626), c1.Location, "#20");
			Assert.AreEqual (new Point (174, 374), c2.Location, "#21");

			sc.AutoScrollPosition = new Point (25, 50);
			Assert.AreEqual (new Point (-25, -50), sc.AutoScrollPosition, "#22");
			Assert.AreEqual (new Rectangle (-25, -50, 410, 810), sc.DisplayRectangle, "#23");
			Assert.AreEqual (new Point (-125, -250), c1.Location, "#24");
			Assert.AreEqual (new Point (375, 750), c2.Location, "#25");
			
			sc.ScrollControlIntoView (c1);


			Assert.AreEqual (Point.Empty, sc.AutoScrollPosition, "#26");
			Assert.AreEqual (new Rectangle (0, 0, 410, 810), sc.DisplayRectangle, "#27");
			Assert.AreEqual (new Point (-100, -200), c1.Location, "#28");
			Assert.AreEqual (new Point (400, 800), c2.Location, "#29");

			sc.AutoScrollPosition = new Point (2500, 5000);
			Assert.AreEqual (new Point (-226, -426), sc.AutoScrollPosition, "#30");
			Assert.AreEqual (new Rectangle (-226, -426, 410, 810), sc.DisplayRectangle, "#31");
			Assert.AreEqual (new Point (-326, -626), c1.Location, "#32");
			Assert.AreEqual (new Point (174, 374), c2.Location, "#33");

			sc.AutoScrollPosition = new Point (25, 50);
			Assert.AreEqual (new Point (-25, -50), sc.AutoScrollPosition, "#34");
			Assert.AreEqual (new Rectangle (-25, -50, 410, 810), sc.DisplayRectangle, "#35");
			Assert.AreEqual (new Point (-125, -250), c1.Location, "#36");
			Assert.AreEqual (new Point (375, 750), c2.Location, "#37");
			
			sc.ScrollControlIntoView (c2);

//.........这里部分代码省略.........
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:101,代码来源:ScrollableControlTest.cs


示例19: AutoScrollMinSize

		public void AutoScrollMinSize ()
		{
			ScrollableControl sc = new ScrollableControl ();
			Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#A1");
			Assert.IsFalse (sc.AutoScroll, "#A2");

			sc.AutoScrollMinSize = Size.Empty;
			Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#B1");
			Assert.IsFalse (sc.AutoScroll, "#B2");

			sc.AutoScrollMinSize = new Size (10, 20);
			Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#C1");
			Assert.IsTrue (sc.AutoScroll, "#C2");

			sc.AutoScroll = false;
			Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#D1");
			Assert.IsFalse (sc.AutoScroll, "#D2");

			sc.AutoScrollMinSize = new Size (10, 20);
			Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#E1");
			Assert.IsFalse (sc.AutoScroll, "#E2");

			sc.AutoScrollMinSize = new Size (20, 20);
			Assert.AreEqual (new Size (20, 20), sc.AutoScrollMinSize, "#F1");
			Assert.IsTrue (sc.AutoScroll, "#F2");

			sc.AutoScroll = false;
			Assert.AreEqual (new Size (20, 20), sc.AutoScrollMinSize, "#G1");
			Assert.IsFalse (sc.AutoScroll, "#G2");

			sc.AutoScrollMinSize = Size.Empty;
			Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#H1");
			Assert.IsTrue (sc.AutoScroll, "#H2");

			sc.AutoScrollMinSize = new Size (10, 20);
			Assert.AreEqual (new Size (10, 20), sc.AutoScrollMinSize, "#I1");
			Assert.IsTrue (sc.AutoScroll, "#I2");

			sc.AutoScrollMinSize = Size.Empty;
			Assert.AreEqual (Size.Empty, sc.AutoScrollMinSize, "#J1");
			Assert.IsTrue (sc.AutoScroll, "#J2");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:42,代码来源:ScrollableControlTest.cs


示例20: AutoScroll

		public void AutoScroll ()
		{
			ScrollableControl sc = new ScrollableControl ();
			Assert.IsFalse (sc.AutoScroll, "#A1");
			Assert.AreEqual (0, sc.Controls.Count, "#A2");

			sc.AutoScroll = true;
			Assert.IsTrue(sc.AutoScroll, "#B1");
			Assert.AreEqual (0, sc.Controls.Count, "#B2");

			sc.AutoScroll = false;
			Assert.IsFalse (sc.AutoScroll, "#C1");
			Assert.AreEqual (0, sc.Controls.Count, "#C2");
		}
开发者ID:calumjiao,项目名称:Mono-Class-Libraries,代码行数:14,代码来源:ScrollableControlTest.cs



注:本文中的System.Windows.Forms.ScrollableControl类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Forms.SplitContainer类代码示例发布时间:2022-05-26
下一篇:
C# Forms.ScrollEventArgs类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap