” fanidan “ checkbox ” mavzusidagi
Download 170.49 Kb.
|
base.MouseDoubleClick += value;
} remove { base.MouseDoubleClick -= value; } } /// /// /// /// /// Gets the information used to create the handle for the /// /// control. /// /// protected override CreateParams CreateParams { [SecurityPermission(SecurityAction.LinkDemand, Flags=SecurityPermissionFlag.UnmanagedCode)] get { CreateParams cp = base.CreateParams; cp.ClassName = "BUTTON"; if (OwnerDraw) { cp.Style |= NativeMethods.BS_OWNERDRAW; } else { cp.Style |= NativeMethods.BS_3STATE; if (Appearance == Appearance.Button) { cp.Style |= NativeMethods.BS_PUSHLIKE; } // Determine the alignment of the check box // ContentAlignment align = RtlTranslateContent(CheckAlign); if ((int)(align & anyRight) != 0) { cp.Style |= NativeMethods.BS_RIGHTBUTTON; } } return cp; } } /// /// /// Deriving classes can override this to configure a default size for their control. /// This is more efficient than setting the size in the control's constructor. /// protected override Size DefaultSize { get { return new Size(104, 24); } } internal override Size GetPreferredSizeCore(Size proposedConstraints) { if (Appearance == Appearance.Button) { ButtonStandardAdapter adapter = new ButtonStandardAdapter(this); return adapter.GetPreferredSizeCore(proposedConstraints); } if(FlatStyle != FlatStyle.System) { return base.GetPreferredSizeCore(proposedConstraints); } Size textSize = TextRenderer.MeasureText(this.Text, this.Font); Size size = SizeFromClientSize(textSize); size.Width += 25; size.Height += 5; return size + Padding.Size; } /// /// /// /// internal override Rectangle OverChangeRectangle { get { if (Appearance == Appearance.Button) { return base.OverChangeRectangle; } else { if (FlatStyle == FlatStyle.Standard) { // this Rectangle will cause no Invalidation // can't use Rectangle.Empty because it will cause Invalidate(ClientRectangle) return new Rectangle(-1, -1, 1, 1); } else { // Popup mouseover rectangle is actually bigger than GetCheckmarkRectangle return Adapter.CommonLayout().Layout().checkBounds; } } } } /// /// /// /// internal override Rectangle DownChangeRectangle { get { if (Appearance == Appearance.Button || FlatStyle == FlatStyle.System) { return base.DownChangeRectangle; } else { Download 170.49 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2025
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling