/// <summary> /// Einige Steuerelemente haben einige wenige hässliche Elemente aus dem Skin; an diese Steuerelemente kommt man über den MessageFilter ran /// </summary> public bool PreFilterMessage(ref Message message) { Control control = Control.FromHandle(message.HWnd); // System.Diagnostics.Debug.WriteLineIf(control!=null,control); ScrollBarBase scrollBar = control as ScrollBarBase; // hässliche Scrollbalken durch Systemstandard ersetzen if (scrollBar != null && scrollBar.LookAndFeel.UseDefaultLookAndFeel) { scrollBar.LookAndFeel.UseDefaultLookAndFeel = false; scrollBar.LookAndFeel.UseWindowsXPTheme = true; scrollBar.LookAndFeel.SetWindowsXPStyle(); } XtraForm xtraForm = control as XtraForm; if (xtraForm != null) { foreach (ISupportLookAndFeel supportLookAndFeel in xtraForm.Controls.OfType <ISupportLookAndFeel>()) // hässliche Buttons & Checkboxen { if (supportLookAndFeel.LookAndFeel.UseDefaultLookAndFeel) { supportLookAndFeel.LookAndFeel.UseDefaultLookAndFeel = false; supportLookAndFeel.LookAndFeel.UseWindowsXPTheme = true; supportLookAndFeel.LookAndFeel.SetWindowsXPStyle(); } } } return(false); }
protected override VCrkScrollBar CreateVScroll() { VCrkScrollBar res = new InvertedVCrkScrollBar(this); ScrollBarBase.ApplyUIMode(res); res.RightToLeft = RightToLeft.No; return(res); }
protected override void UpdateDXScrollBar(bool isHorz) { if (IsLockUpdate) { return; } ScrollBarBase dxScroll = isHorz ? (ScrollBarBase)HScroll : (ScrollBarBase)VScroll; if (SourceControl == null) { return; } if (!SourceControl.IsHandleCreated || !dxScroll.Parent.IsHandleCreated) { dxScroll.Visible = false; return; } BeginUpdate(); try { SCROLLBARINFO sbInfo = new SCROLLBARINFO(); sbInfo.Init(); SCROLLBARINFO.GetScrollBarInfo(SourceControl.Handle, isHorz ? SCROLLBARINFO.OBJID_HSCROLL : SCROLLBARINFO.OBJID_VSCROLL, ref sbInfo); Rectangle scrollBounds = sbInfo.rcScrollBar.ToRectangle(); if ((SourceControl != null && !SourceControl.Visible) || scrollBounds.IsEmpty || sbInfo.rgstate0 == SCROLLBARINFO.STATE_SYSTEM_INVISIBLE || sbInfo.rgstate0 == SCROLLBARINFO.STATE_SYSTEM_OFFSCREEN) { dxScroll.Visible = false; return; } scrollBounds = dxScroll.Parent.RectangleToClient(scrollBounds); if (isHorz) { scrollBounds.Height = fWidth; } else { scrollBounds.Width = fWidth; } dxScroll.Bounds = scrollBounds; ScrollArgs currentArgs = new ScrollArgs(dxScroll), args = new ScrollArgs(); if (sbInfo.rgstate0 == SCROLLBARINFO.STATE_SYSTEM_UNAVAILABLE) { args.Maximum = args.Minimum = 0; args.Value = 0; args.Enabled = false; } else { SCROLLINFO sInfo = new SCROLLINFO(); sInfo.Init(); SCROLLINFO.GetScrollInfo(SourceControl.Handle, isHorz ? SCROLLINFO.SB_HORZ : SCROLLINFO.SB_VERT, ref sInfo); args.Enabled = true; args.Maximum = sInfo.nMax; args.Minimum = sInfo.nMin; args.LargeChange = sInfo.nPage; args.SmallChange = isHorz ? 8 : 1; args.Value = sInfo.nTrackPos; } dxScroll.Visible = true; if (currentArgs.IsEquals(args)) { return; } args.AssignTo(dxScroll); } finally { EndUpdate(); } }
protected internal virtual void EndScrollbarUpdate(ScrollBarBase scrollbar);