|
この記事は機械翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 詳細情報
|
訳文
原文
|
UserControl クラス
System.MarshalByRefObject
System.ComponentModel.Component
System.Windows.Forms.Control
System.Windows.Forms.ScrollableControl
System.Windows.Forms.ContainerControl
System.Windows.Forms.UserControl
Microsoft.VisualBasic.Compatibility.VB6.ADODC
System.Web.UI.Design.WebControls.ParameterEditorUserControl
System.Workflow.ComponentModel.Design.WorkflowOutline
System.Workflow.ComponentModel.Design.WorkflowView
名前空間: System.Windows.Forms
アセンブリ: System.Windows.Forms (System.Windows.Forms.dll 内)
UserControl 型で公開されるメンバーは以下のとおりです。
| 名前 | 説明 | |
|---|---|---|
![]() | AccessibilityObject | |
![]() | AccessibleDefaultActionDescription | |
![]() | AccessibleDescription | |
![]() | AccessibleName | |
![]() | AccessibleRole | |
![]() | ActiveControl | |
![]() | AllowDrop | |
![]() | Anchor | |
![]() | AutoScaleDimensions | |
![]() | AutoScaleFactor | |
![]() | AutoScaleMode | |
![]() | AutoScroll | |
![]() | AutoScrollMargin | |
![]() | AutoScrollMinSize | |
![]() | AutoScrollOffset | |
![]() | AutoScrollPosition | |
![]() | AutoSize | |
![]() | AutoSizeMode | |
![]() | AutoValidate | |
![]() | BackColor | |
![]() | BackgroundImage | |
![]() | BackgroundImageLayout | |
![]() | BindingContext | |
![]() | BorderStyle | |
![]() | Bottom | |
![]() | Bounds | |
![]() | CanEnableIme | |
![]() | CanFocus | |
![]() | CanRaiseEvents | |
![]() | CanSelect | |
![]() | Capture | |
![]() | CausesValidation | |
![]() | ClientRectangle | |
![]() | ClientSize | |
![]() | CompanyName | |
![]() | Container | |
![]() | ContainsFocus | |
![]() | ContextMenu | |
![]() | ContextMenuStrip | |
![]() | Controls | |
![]() | Created | |
![]() | CreateParams | インフラストラクチャ。 |
![]() | CurrentAutoScaleDimensions | |
![]() | Cursor | |
![]() | DataBindings | |
![]() | DefaultCursor | |
![]() | DefaultImeMode | |
![]() | DefaultMargin | |
![]() | DefaultMaximumSize | |
![]() | DefaultMinimumSize | |
![]() | DefaultPadding | |
![]() | DefaultSize | |
![]() | DesignMode | |
![]() | DisplayRectangle | |
![]() | Disposing | |
![]() | Dock | |
![]() | DockPadding | |
![]() | DoubleBuffered | |
![]() | Enabled | |
![]() | Events | |
![]() | Focused | |
![]() | Font | |
![]() | FontHeight | |
![]() | ForeColor | |
![]() | Handle | |
![]() | HasChildren | |
![]() | Height | |
![]() | HorizontalScroll | |
![]() | HScroll | |
![]() | ImeMode | |
![]() | ImeModeBase | |
![]() | InvokeRequired | |
![]() | IsAccessible | |
![]() | IsDisposed | |
![]() | IsHandleCreated | |
![]() | IsMirrored | |
![]() | LayoutEngine | |
![]() | Left | |
![]() | Location | |
![]() | Margin | |
![]() | MaximumSize | |
![]() | MinimumSize | |
![]() | Name | |
![]() | Padding | |
![]() | Parent | |
![]() | ParentForm | |
![]() | PreferredSize | |
![]() | ProductName | |
![]() | ProductVersion | |
![]() | RecreatingHandle | |
![]() | Region | |
![]() | RenderRightToLeft | 互換性のために残されています。 |
![]() | ResizeRedraw | |
![]() | Right | |
![]() | RightToLeft | |
![]() | ScaleChildren | |
![]() | ShowFocusCues | |
![]() | ShowKeyboardCues | |
![]() | Site | |
![]() | Size | |
![]() | TabIndex | |
![]() | TabStop | |
![]() | Tag | |
![]() | Text | |
![]() | Top | |
![]() | TopLevelControl | |
![]() | UseWaitCursor | |
![]() | VerticalScroll | |
![]() | Visible | |
![]() | VScroll | |
![]() | Width | |
![]() | WindowTarget | インフラストラクチャ。 |
| 名前 | 説明 | |
|---|---|---|
![]() | AccessibilityNotifyClients(AccessibleEvents, Int32) | |
![]() | AccessibilityNotifyClients(AccessibleEvents, Int32, Int32) | |
![]() | AdjustFormScrollbars | インフラストラクチャ。 |
![]() | BeginInvoke(Delegate) | |
![]() | BeginInvoke(Delegate, Object[]) | |
![]() | BringToFront | |
![]() | Contains | |
![]() | CreateAccessibilityInstance | |
![]() | CreateControl | |
![]() | CreateControlsInstance | |
![]() | CreateGraphics | |
![]() | CreateHandle | |
![]() | CreateObjRef | |
![]() | DefWndProc | |
![]() | DestroyHandle | |
![]() | Dispose() | |
![]() | Dispose(Boolean) | |
![]() | DoDragDrop | |
![]() | DrawToBitmap | |
![]() | EndInvoke | |
![]() | Equals(Object) | |
![]() | Finalize | |
![]() | FindForm | |
![]() | Focus | |
![]() | GetAccessibilityObjectById | |
![]() | GetAutoSizeMode | |
![]() | GetChildAtPoint(Point) | |
![]() | GetChildAtPoint(Point, GetChildAtPointSkip) | |
![]() | GetContainerControl | |
![]() | GetHashCode | |
![]() | GetLifetimeService | |
![]() | GetNextControl | |
![]() | GetPreferredSize | |
![]() | GetScaledBounds | |
![]() | GetScrollState | |
![]() | GetService | |
![]() | GetStyle | |
![]() | GetTopLevel | |
![]() | GetType | |
![]() | Hide | |
![]() | InitializeLifetimeService | |
![]() | InitLayout | |
![]() | Invalidate() | |
![]() | Invalidate(Boolean) | |
![]() | Invalidate(Rectangle) | |
![]() | Invalidate(Region) | |
![]() | Invalidate(Rectangle, Boolean) | |
![]() | Invalidate(Region, Boolean) | |
![]() | Invoke(Delegate) | |
![]() | Invoke(Delegate, Object[]) | |
![]() | InvokeGotFocus | |
![]() | InvokeLostFocus | |
![]() | InvokeOnClick | |
![]() | InvokePaint | |
![]() | InvokePaintBackground | |
![]() | IsInputChar | |
![]() | IsInputKey | |
![]() | MemberwiseClone() | |
![]() | MemberwiseClone(Boolean) | |
![]() | NotifyInvalidate | インフラストラクチャ。 |
![]() | OnAutoSizeChanged | |
![]() | OnAutoValidateChanged | |
![]() | OnBackColorChanged | |
![]() | OnBackgroundImageChanged | |
![]() | OnBackgroundImageLayoutChanged | |
![]() | OnBindingContextChanged | |
![]() | OnCausesValidationChanged | |
![]() | OnChangeUICues | |
![]() | OnClick | |
![]() | OnClientSizeChanged | |
![]() | OnContextMenuChanged | |
![]() | OnContextMenuStripChanged | |
![]() | OnControlAdded | |
![]() | OnControlRemoved | |
![]() | OnCreateControl | |
![]() | OnCursorChanged | |
![]() | OnDockChanged | |
![]() | OnDoubleClick | |
![]() | OnDragDrop | |
![]() | OnDragEnter | |
![]() | OnDragLeave | |
![]() | OnDragOver | |
![]() | OnEnabledChanged | |
![]() | OnEnter | |
![]() | OnFontChanged | |
![]() | OnForeColorChanged | |
![]() | OnGiveFeedback | |
![]() | OnGotFocus | |
![]() | OnHandleCreated | |
![]() | OnHandleDestroyed | |
![]() | OnHelpRequested | |
![]() | OnImeModeChanged | |
![]() | OnInvalidated | |
![]() | OnKeyDown | |
![]() | OnKeyPress | |
![]() | OnKeyUp | |
![]() | OnLayout | |
![]() | OnLeave | |
![]() | OnLoad | |
![]() | OnLocationChanged | |
![]() | OnLostFocus | |
![]() | OnMarginChanged | |
![]() | OnMouseCaptureChanged | |
![]() | OnMouseClick | |
![]() | OnMouseDoubleClick | |
![]() | OnMouseDown | |
![]() | OnMouseEnter | |
![]() | OnMouseHover | |
![]() | OnMouseLeave | |
![]() | OnMouseMove | |
![]() | OnMouseUp | |
![]() | OnMouseWheel | |
![]() | OnMove | |
![]() | OnNotifyMessage | |
![]() | OnPaddingChanged | |
![]() | OnPaint | |
![]() | OnPaintBackground | |
![]() | OnParentBackColorChanged | |
![]() | OnParentBackgroundImageChanged | |
![]() | OnParentBindingContextChanged | |
![]() | OnParentChanged | |
![]() | OnParentCursorChanged | |
![]() | OnParentEnabledChanged | |
![]() | OnParentFontChanged | |
![]() | OnParentForeColorChanged | |
![]() | OnParentRightToLeftChanged | |
![]() | OnParentVisibleChanged | |
![]() | OnPreviewKeyDown | |
![]() | OnPrint | |
![]() | OnQueryContinueDrag | |
![]() | OnRegionChanged | |
![]() | OnResize | インフラストラクチャ。 |
![]() | OnRightToLeftChanged | |
![]() | OnScroll | |
![]() | OnSizeChanged | |
![]() | OnStyleChanged | |
![]() | OnSystemColorsChanged | |
![]() | OnTabIndexChanged | |
![]() | OnTabStopChanged | |
![]() | OnTextChanged | |
![]() | OnValidated | |
![]() | OnValidating | |
![]() | OnVisibleChanged | |
![]() | PerformAutoScale | |
![]() | PerformLayout() | |
![]() | PerformLayout(Control, String) | |
![]() | PointToClient | |
![]() | PointToScreen | |
![]() | PreProcessControlMessage | |
![]() | PreProcessMessage | |
![]() | ProcessCmdKey | |
![]() | ProcessDialogChar | インフラストラクチャ。 |
![]() | ProcessDialogKey | インフラストラクチャ。 |
![]() | ProcessKeyEventArgs | |
![]() | ProcessKeyMessage | |
![]() | ProcessKeyPreview | |
![]() | ProcessMnemonic | インフラストラクチャ。 |
![]() | ProcessTabKey | |
![]() | RaiseDragEvent | インフラストラクチャ。 |
![]() | RaiseKeyEvent | インフラストラクチャ。 |
![]() | RaiseMouseEvent | インフラストラクチャ。 |
![]() | RaisePaintEvent | インフラストラクチャ。 |
![]() | RecreateHandle | |
![]() | RectangleToClient | |
![]() | RectangleToScreen | |
![]() | Refresh | |
![]() | ResetBackColor | |
![]() | ResetBindings | |
![]() | ResetCursor | |
![]() | ResetFont | |
![]() | ResetForeColor | |
![]() | ResetImeMode | |
![]() | ResetMouseEventArgs | インフラストラクチャ。 |
![]() | ResetRightToLeft | |
![]() | ResetText | |
![]() | ResumeLayout() | |
![]() | ResumeLayout(Boolean) | |
![]() | RtlTranslateAlignment(ContentAlignment) | |
![]() | RtlTranslateAlignment(HorizontalAlignment) | |
![]() | RtlTranslateAlignment(LeftRightAlignment) | |
![]() | RtlTranslateContent | |
![]() | RtlTranslateHorizontal | |
![]() | RtlTranslateLeftRight | |
![]() | Scale(Single) | 互換性のために残されています。 |
![]() | Scale(SizeF) | |
![]() | Scale(Single, Single) | 互換性のために残されています。 |
![]() | ScaleControl | |
![]() | ScaleCore | |
![]() | ScrollControlIntoView | |
![]() | ScrollToControl | |
![]() | Select() | |
![]() | Select(Boolean, Boolean) | |
![]() | SelectNextControl | |
![]() | SendToBack | |
![]() | SetAutoScrollMargin | |
![]() | SetAutoSizeMode | |
![]() | SetBounds(Int32, Int32, Int32, Int32) | |
![]() | SetBounds(Int32, Int32, Int32, Int32, BoundsSpecified) | |
![]() | SetBoundsCore | |
![]() | SetClientSizeCore | |
![]() | SetDisplayRectLocation | |
![]() | SetScrollState | |
![]() | SetStyle | |
![]() | SetTopLevel | |
![]() | SetVisibleCore | |
![]() | Show | |
![]() | SizeFromClientSize | |
![]() | SuspendLayout | |
![]() | ToString | |
![]() | Update | |
![]() | UpdateBounds() | |
![]() | UpdateBounds(Int32, Int32, Int32, Int32) | |
![]() | UpdateBounds(Int32, Int32, Int32, Int32, Int32, Int32) | |
![]() | UpdateDefaultButton | |
![]() | UpdateStyles | |
![]() | UpdateZOrder | |
![]() | Validate() | |
![]() | Validate(Boolean) | |
![]() | ValidateChildren() | |
![]() | ValidateChildren(ValidationConstraints) | |
![]() | WndProc |
| 名前 | 説明 | |
|---|---|---|
![]() | AutoSizeChanged | |
![]() | AutoValidateChanged | |
![]() | BackColorChanged | |
![]() | BackgroundImageChanged | |
![]() | BackgroundImageLayoutChanged | |
![]() | BindingContextChanged | |
![]() | CausesValidationChanged | |
![]() | ChangeUICues | |
![]() | Click | |
![]() | ClientSizeChanged | |
![]() | ContextMenuChanged | |
![]() | ContextMenuStripChanged | |
![]() | ControlAdded | |
![]() | ControlRemoved | |
![]() | CursorChanged | |
![]() | Disposed | |
![]() | DockChanged | |
![]() | DoubleClick | |
![]() | DragDrop | |
![]() | DragEnter | |
![]() | DragLeave | |
![]() | DragOver | |
![]() | EnabledChanged | |
![]() | Enter | |
![]() | FontChanged | |
![]() | ForeColorChanged | |
![]() | GiveFeedback | |
![]() | GotFocus | |
![]() | HandleCreated | |
![]() | HandleDestroyed | |
![]() | HelpRequested | |
![]() | ImeModeChanged | |
![]() | Invalidated | |
![]() | KeyDown | |
![]() | KeyPress | |
![]() | KeyUp | |
![]() | Layout | |
![]() | Leave | |
![]() | Load | |
![]() | LocationChanged | |
![]() | LostFocus | |
![]() | MarginChanged | |
![]() | MouseCaptureChanged | |
![]() | MouseClick | |
![]() | MouseDoubleClick | |
![]() | MouseDown | |
![]() | MouseEnter | |
![]() | MouseHover | |
![]() | MouseLeave | |
![]() | MouseMove | |
![]() | MouseUp | |
![]() | MouseWheel | |
![]() | Move | |
![]() | PaddingChanged | |
![]() | Paint | |
![]() | ParentChanged | |
![]() | PreviewKeyDown | |
![]() | QueryAccessibilityHelp | |
![]() | QueryContinueDrag | |
![]() | RegionChanged | |
![]() | Resize | |
![]() | RightToLeftChanged | |
![]() | Scroll | |
![]() | SizeChanged | |
![]() | StyleChanged | |
![]() | SystemColorsChanged | |
![]() | TabIndexChanged | |
![]() | TabStopChanged | |
![]() | TextChanged | インフラストラクチャ。 |
![]() | Validated | |
![]() | Validating | |
![]() | VisibleChanged |
| 名前 | 説明 | |
|---|---|---|
![]() ![]() | IContainerControl.ActivateControl | |
![]() ![]() | IDropTarget.OnDragDrop | インフラストラクチャ。 |
![]() ![]() | IDropTarget.OnDragEnter | インフラストラクチャ。 |
![]() ![]() | IDropTarget.OnDragLeave | インフラストラクチャ。 |
![]() ![]() | IDropTarget.OnDragOver | インフラストラクチャ。 |
メモ |
|---|
メモ |
|---|
using System; using System.Windows.Forms; using System.Drawing; using System.ComponentModel; namespace UserControls { public class MyCustomerInfoUserControl : System.Windows.Forms.UserControl { // Create the controls. private System.Windows.Forms.ErrorProvider errorProvider1; private System.Windows.Forms.TextBox textName; private System.Windows.Forms.TextBox textAddress; private System.Windows.Forms.TextBox textCity; private System.Windows.Forms.TextBox textStateProvince; private System.Windows.Forms.TextBox textPostal; private System.Windows.Forms.TextBox textCountryRegion; private System.Windows.Forms.TextBox textEmail; private System.Windows.Forms.Label labelName; private System.Windows.Forms.Label labelAddress; private System.Windows.Forms.Label labelCityStateProvincePostal; private System.Windows.Forms.Label labelCountryRegion; private System.Windows.Forms.Label labelEmail; private System.ComponentModel.IContainer components; // Define the constructor. public MyCustomerInfoUserControl() { InitializeComponent(); } // Initialize the control elements. public void InitializeComponent() { // Initialize the controls. components = new System.ComponentModel.Container(); errorProvider1 = new System.Windows.Forms.ErrorProvider(); textName = new System.Windows.Forms.TextBox(); textAddress = new System.Windows.Forms.TextBox(); textCity = new System.Windows.Forms.TextBox(); textStateProvince = new System.Windows.Forms.TextBox(); textPostal = new System.Windows.Forms.TextBox(); textCountryRegion = new System.Windows.Forms.TextBox(); textEmail = new System.Windows.Forms.TextBox(); labelName = new System.Windows.Forms.Label(); labelAddress = new System.Windows.Forms.Label(); labelCityStateProvincePostal = new System.Windows.Forms.Label(); labelCountryRegion = new System.Windows.Forms.Label(); labelEmail = new System.Windows.Forms.Label(); // Set the tab order, text alignment, size, and location of the controls. textName.Location = new System.Drawing.Point(120, 8); textName.Size = new System.Drawing.Size(232, 20); textName.TabIndex = 0; textAddress.Location = new System.Drawing.Point(120, 32); textAddress.Size = new System.Drawing.Size(232, 20); textAddress.TabIndex = 1; textCity.Location = new System.Drawing.Point(120, 56); textCity.Size = new System.Drawing.Size(96, 20); textCity.TabIndex = 2; textStateProvince.Location = new System.Drawing.Point(216, 56); textStateProvince.Size = new System.Drawing.Size(56, 20); textStateProvince.TabIndex = 3; textPostal.Location = new System.Drawing.Point(272, 56); textPostal.Size = new System.Drawing.Size(80, 20); textPostal.TabIndex = 4; textCountryRegion.Location = new System.Drawing.Point(120, 80); textCountryRegion.Size = new System.Drawing.Size(232, 20); textCountryRegion.TabIndex = 5; textEmail.Location = new System.Drawing.Point(120, 104); textEmail.Size = new System.Drawing.Size(232, 20); textEmail.TabIndex = 6; labelName.Location = new System.Drawing.Point(8, 8); labelName.Size = new System.Drawing.Size(112, 23); labelName.Text = "Name:"; labelName.TextAlign = System.Drawing.ContentAlignment.MiddleRight; labelAddress.Location = new System.Drawing.Point(8, 32); labelAddress.Size = new System.Drawing.Size(112, 23); labelAddress.Text = "Address:"; labelAddress.TextAlign = System.Drawing.ContentAlignment.MiddleRight; labelCityStateProvincePostal.Location = new System.Drawing.Point(8, 56); labelCityStateProvincePostal.Size = new System.Drawing.Size(112, 23); labelCityStateProvincePostal.Text = "City, St/Prov. Postal:"; labelCityStateProvincePostal.TextAlign = System.Drawing.ContentAlignment.MiddleRight; labelCountryRegion.Location = new System.Drawing.Point(8, 80); labelCountryRegion.Size = new System.Drawing.Size(112, 23); labelCountryRegion.Text = "Country/Region:"; labelCountryRegion.TextAlign = System.Drawing.ContentAlignment.MiddleRight; labelEmail.Location = new System.Drawing.Point(8, 104); labelEmail.Size = new System.Drawing.Size(112, 23); labelEmail.Text = "email:"; labelEmail.TextAlign = System.Drawing.ContentAlignment.MiddleRight; // Add the Validating and Validated handlers for textEmail. textEmail.Validating += new System.ComponentModel.CancelEventHandler(textEmail_Validating); textEmail.Validated += new System.EventHandler(textEmail_Validated); // Add the controls to the user control. Controls.AddRange(new System.Windows.Forms.Control[] { labelName, labelAddress, labelCityStateProvincePostal, labelCountryRegion, labelEmail, textName, textAddress, textCity, textStateProvince, textPostal, textCountryRegion, textEmail }); // Size the user control. Size = new System.Drawing.Size(375, 150); } private void MyValidatingCode() { // Confirm there is text in the control. if (textEmail.Text.Length == 0) { throw new Exception("Email address is a required field."); } // Confirm that there is a "." and an "@" in the e-mail address. else if(textEmail.Text.IndexOf(".") == -1 || textEmail.Text.IndexOf("@") == -1) { throw new Exception("Email address must be valid e-mail address format." + "\nFor example: 'someone@example.com'"); } } // Validate the data input by the user into textEmail. private void textEmail_Validating(object sender, System.ComponentModel.CancelEventArgs e) { try { MyValidatingCode(); } catch(Exception ex) { // Cancel the event and select the text to be corrected by the user. e.Cancel = true; textEmail.Select(0, textEmail.Text.Length); // Set the ErrorProvider error with the text to display. this.errorProvider1.SetError(textEmail,ex.Message); } } private void textEmail_Validated(Object sender, System.EventArgs e) { //If all conditions have been met, clear the error provider of errors. errorProvider1.SetError(textEmail, ""); } } // End Class } // End Namespace
Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (サーバー コア ロールはサポート対象外), Windows Server 2008 R2 (SP1 以降でサーバー コア ロールをサポート。Itanium はサポート対象外)
.NET Framework では、各プラットフォームのすべてのバージョンはサポートしていません。サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。
