GrapeCity.Win.Components 名前空間 > GcResize クラス : InitializeSettings プロパティ |
Public ReadOnly Property InitializeSettings As InitializeSettings
public InitializeSettings InitializeSettings {get;}
次のサンプルコードは、InitializeSettings を使用して、ターゲットフォームが初期化されるときにターゲットをサイズ変更する方法を示します。
using System; using System.Collections.Generic; using System.Drawing; using System.Text; using System.Windows.Forms; using GrapeCity.Win.Components; namespace GrapeCity.Win.PlusPak.SampleCodes_CS { public class GcResizeInitializeSettingsDemo : Form { private Components.GcResize gcResize1; private Button button3; private Button button2; private Button button1; private System.ComponentModel.IContainer components; public GcResizeInitializeSettingsDemo() { InitializeComponent(); } [STAThread] public static void Main(string[] args) { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new GcResizeInitializeSettingsDemo()); } private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.gcResize1 = new GrapeCity.Win.Components.GcResize(this.components); this.button1 = new System.Windows.Forms.Button(); this.button2 = new System.Windows.Forms.Button(); this.button3 = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.gcResize1)).BeginInit(); this.SuspendLayout(); // // gcResize1 // this.gcResize1.Target = this; this.gcResize1.InitializeSettings.FactorX = 2; this.gcResize1.InitializeSettings.FactorY = 2; this.gcResize1.InitializeSettings.Size = new Size(800, 600); // // button1 // this.button1.Location = new System.Drawing.Point(38, 39); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(195, 23); this.button1.TabIndex = 0; this.button1.Text = "InitializeMode.Size"; this.button1.UseVisualStyleBackColor = true; this.button1.Click += new System.EventHandler(this.button1_Click); // // button2 // this.button2.Location = new System.Drawing.Point(38, 80); this.button2.Name = "button2"; this.button2.Size = new System.Drawing.Size(195, 23); this.button2.TabIndex = 1; this.button2.Text = "InitializeMode.Factor"; this.button2.UseVisualStyleBackColor = true; this.button2.Click += new System.EventHandler(this.button2_Click); // // button3 // this.button3.Location = new System.Drawing.Point(38, 123); this.button3.Name = "button3"; this.button3.Size = new System.Drawing.Size(195, 23); this.button3.TabIndex = 2; this.button3.Text = "InitializeMode.FillScreen"; this.button3.UseVisualStyleBackColor = true; this.button3.Click += new System.EventHandler(this.button3_Click); // // GcResizeInitializeSettingsDemo // this.ClientSize = new System.Drawing.Size(284, 261); this.Controls.Add(this.button3); this.Controls.Add(this.button2); this.Controls.Add(this.button1); this.Name = "GcResizeInitializeSettingsDemo"; ((System.ComponentModel.ISupportInitialize)(this.gcResize1)).EndInit(); this.ResumeLayout(false); } private void button1_Click(object sender, EventArgs e) { var demo = new GcResizeInitializeSettingsDemo(); demo.gcResize1.InitializeSettings.InitializeMode = InitializeMode.Size; demo.Show(); } private void button2_Click(object sender, EventArgs e) { var demo = new GcResizeInitializeSettingsDemo(); demo.gcResize1.InitializeSettings.InitializeMode = InitializeMode.Factor; demo.Show(); } private void button3_Click(object sender, EventArgs e) { var demo = new GcResizeInitializeSettingsDemo(); demo.gcResize1.InitializeSettings.InitializeMode = InitializeMode.FillScreen; demo.Show(); } } }
Imports System.Collections.Generic Imports System.Drawing Imports System.Text Imports System.Windows.Forms Imports GrapeCity.Win.Components Namespace GrapeCity.Win.PlusPak.SampleCodes_VB Public Class GcResizeInitializeSettingsDemo Inherits Form Private gcResize1 As Components.GcResize Private button3 As Button Private button2 As Button Private button1 As Button Private components As System.ComponentModel.IContainer Public Sub New() InitializeComponent() End Sub Private Sub InitializeComponent() Me.components = New System.ComponentModel.Container() Me.gcResize1 = New GcResize(Me.components) Me.button1 = New System.Windows.Forms.Button() Me.button2 = New System.Windows.Forms.Button() Me.button3 = New System.Windows.Forms.Button() DirectCast(Me.gcResize1, System.ComponentModel.ISupportInitialize).BeginInit() Me.SuspendLayout() ' ' gcResize1 ' Me.gcResize1.Target = Me Me.gcResize1.InitializeSettings.FactorX = 2 Me.gcResize1.InitializeSettings.FactorY = 2 Me.gcResize1.InitializeSettings.Size = New Size(800, 600) ' ' button1 ' Me.button1.Location = New System.Drawing.Point(38, 39) Me.button1.Name = "button1" Me.button1.Size = New System.Drawing.Size(195, 23) Me.button1.TabIndex = 0 Me.button1.Text = "InitializeMode.Size" Me.button1.UseVisualStyleBackColor = True AddHandler Me.button1.Click, New System.EventHandler(AddressOf Me.button1_Click) ' ' button2 ' Me.button2.Location = New System.Drawing.Point(38, 80) Me.button2.Name = "button2" Me.button2.Size = New System.Drawing.Size(195, 23) Me.button2.TabIndex = 1 Me.button2.Text = "InitializeMode.Factor" Me.button2.UseVisualStyleBackColor = True AddHandler Me.button2.Click, New System.EventHandler(AddressOf Me.button2_Click) ' ' button3 ' Me.button3.Location = New System.Drawing.Point(38, 123) Me.button3.Name = "button3" Me.button3.Size = New System.Drawing.Size(195, 23) Me.button3.TabIndex = 2 Me.button3.Text = "InitializeMode.FillScreen" Me.button3.UseVisualStyleBackColor = True AddHandler Me.button3.Click, New System.EventHandler(AddressOf Me.button3_Click) ' ' GcResizeInitializeSettingsDemo ' Me.ClientSize = New System.Drawing.Size(284, 261) Me.Controls.Add(Me.button3) Me.Controls.Add(Me.button2) Me.Controls.Add(Me.button1) Me.Name = "GcResizeInitializeSettingsDemo" DirectCast(Me.gcResize1, System.ComponentModel.ISupportInitialize).EndInit() Me.ResumeLayout(False) End Sub Private Sub button1_Click(sender As Object, e As EventArgs) Dim demo = New GcResizeInitializeSettingsDemo() demo.gcResize1.InitializeSettings.InitializeMode = InitializeMode.Size demo.Show() End Sub Private Sub button2_Click(sender As Object, e As EventArgs) Dim demo = New GcResizeInitializeSettingsDemo() demo.gcResize1.InitializeSettings.InitializeMode = InitializeMode.Factor demo.Show() End Sub Private Sub button3_Click(sender As Object, e As EventArgs) Dim demo = New GcResizeInitializeSettingsDemo() demo.gcResize1.InitializeSettings.InitializeMode = InitializeMode.FillScreen demo.Show() End Sub End Class End Namespace
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2