Hi,
Can the syntax editor popup search window background color be changed at run time?
Thanks,
Rob
Hello,
Yes this is possible.
Could you please try something like this:
public class MyPainter : Alternet.Editor.Dialogs.VsControls.Painting.VsControlsPainterVS2017Blue
{
protected override int ControlBackgroundColor => Color.Blue.ToArgb();
}
private void Form1_Load(object sender, EventArgs e)
{
Alternet.Editor.Dialogs.VsControls.Painting.VsControlsTheme.Painter = new MyPainter();
}
regards,
Andrew
Yes this is possible.
Could you please try something like this:
public class MyPainter : Alternet.Editor.Dialogs.VsControls.Painting.VsControlsPainterVS2017Blue
{
protected override int ControlBackgroundColor => Color.Blue.ToArgb();
}
private void Form1_Load(object sender, EventArgs e)
{
Alternet.Editor.Dialogs.VsControls.Painting.VsControlsTheme.Painter = new MyPainter();
}
regards,
Andrew
Thanks ... works perfect. Another question, can I control the painting of the comboboxes.
Rob
Rob
One other question. Can the dark blue line at the bottom of the search popup be changed?
Rob
Rob
Hello,
there is a code to change dark blue line at the bottom:
public class MySearchDialogPainter : PopupPanelSearchDialogPainterVS2017Blue
{
protected override int FocusHighlightIndicatorNonFocusedColor => Color.Red.ToArgb();
protected override int FocusHighlightIndicatorFocusedColor => Color.Violet.ToArgb();
}
PopupPanelSearchDialogTheme.Painter = new MySearchDialogPainter();
There is a code to customize combobox painting:
class MySyntaxEdit : SyntaxEdit
{
class MyPopupPanelSearchDialog : PopupPanelSearchDialog
{
class MyPopupPanelDlgSearch : PopupPanelDlgSearch
{
public IEnumerable GetAll(Control control) where T: Control
{
var controls = control.Controls.Cast();
return controls.SelectMany(ctrl => GetAll(ctrl)).Concat(controls).Where(c => c is T).Cast();
}
public MyPopupPanelDlgSearch()
{
foreach(var cb in GetAll(this))
{
cb.BackColor = Color.Green;
cb.DrawMode = DrawMode.OwnerDrawFixed;
cb.DrawItem += (o, e) =>
{
//
};
}
}
}
protected override PopupPanelDlgSearch CreateSearchDlg() => new MyPopupPanelDlgSearch();
}
protected override ISearchDialog CreateSearchDialog() => new MyPopupPanelSearchDialog();
}
syntaxEdit1 = new MySyntaxEdit();
regards,
Andrew
there is a code to change dark blue line at the bottom:
public class MySearchDialogPainter : PopupPanelSearchDialogPainterVS2017Blue
{
protected override int FocusHighlightIndicatorNonFocusedColor => Color.Red.ToArgb();
protected override int FocusHighlightIndicatorFocusedColor => Color.Violet.ToArgb();
}
PopupPanelSearchDialogTheme.Painter = new MySearchDialogPainter();
There is a code to customize combobox painting:
class MySyntaxEdit : SyntaxEdit
{
class MyPopupPanelSearchDialog : PopupPanelSearchDialog
{
class MyPopupPanelDlgSearch : PopupPanelDlgSearch
{
public IEnumerable
{
var controls = control.Controls.Cast
return controls.SelectMany(ctrl => GetAll
}
public MyPopupPanelDlgSearch()
{
foreach(var cb in GetAll
{
cb.BackColor = Color.Green;
cb.DrawMode = DrawMode.OwnerDrawFixed;
cb.DrawItem += (o, e) =>
{
//
};
}
}
}
protected override PopupPanelDlgSearch CreateSearchDlg() => new MyPopupPanelDlgSearch();
}
protected override ISearchDialog CreateSearchDialog() => new MyPopupPanelSearchDialog();
}
syntaxEdit1 = new MySyntaxEdit();
regards,
Andrew
I can't find painter PopupPanelSearchDialogPainterVS2017Blue
in Alternet.Editor.Dialogs.VsControls.Painting.
Rob
in Alternet.Editor.Dialogs.VsControls.Painting.
Rob
Hello,
you can find PopupPanelSearchDialogPainterVS2017Blue in the Alternet.Editor.Dialogs.PopupPanel.Painting.
regards,
Andrew
you can find PopupPanelSearchDialogPainterVS2017Blue in the Alternet.Editor.Dialogs.PopupPanel.Painting.
regards,
Andrew