コード例 #1
0
        public void MethodScaleControl()
        {
            Form f = new Form();

            f.ShowInTaskbar = false;

            f.Show();

            PublicGroupBox gb = new PublicGroupBox();

            gb.Location = new Point(5, 10);
            f.Controls.Add(gb);

            Assert.AreEqual(new Rectangle(5, 10, 200, 100), gb.Bounds, "A1");

            gb.PublicScaleControl(new SizeF(2.0f, 2.0f), BoundsSpecified.All);
            Assert.AreEqual(new Rectangle(10, 20, 400, 200), gb.Bounds, "A2");

            gb.PublicScaleControl(new SizeF(.5f, .5f), BoundsSpecified.Location);
            Assert.AreEqual(new Rectangle(5, 10, 400, 200), gb.Bounds, "A3");

            gb.PublicScaleControl(new SizeF(.5f, .5f), BoundsSpecified.Size);
            Assert.AreEqual(new Rectangle(5, 10, 200, 100), gb.Bounds, "A4");

            f.Dispose();
        }
コード例 #2
0
ファイル: GroupBoxTest.cs プロジェクト: Profit0004/mono
		public void MethodScaleControl ()
		{
			Form f = new Form ();
			f.ShowInTaskbar = false;
			
			f.Show ();

			PublicGroupBox gb = new PublicGroupBox ();
			gb.Location = new Point (5, 10);
			f.Controls.Add (gb);
			
			Assert.AreEqual (new Rectangle (5, 10, 200, 100), gb.Bounds, "A1");
			
			gb.PublicScaleControl (new SizeF (2.0f, 2.0f), BoundsSpecified.All);
			Assert.AreEqual (new Rectangle (10, 20, 400, 200), gb.Bounds, "A2");

			gb.PublicScaleControl (new SizeF (.5f, .5f), BoundsSpecified.Location);
			Assert.AreEqual (new Rectangle (5, 10, 400, 200), gb.Bounds, "A3");

			gb.PublicScaleControl (new SizeF (.5f, .5f), BoundsSpecified.Size);
			Assert.AreEqual (new Rectangle (5, 10, 200, 100), gb.Bounds, "A4");
			
			f.Dispose ();
		}