/// <summary> /// Apply thememanager theme to the treeview /// </summary> public void StyleOvlTree() { this.SafeInvoke(form => { OlvStyler.StyleIt(fastOLV, StrEmptyList); fastOLV.DefaultRenderer = new FilteredItemTextRenderer(); }); }
/// <summary> /// Constructor for the autocompletion form /// </summary> /// <param name="initialFilter"></param> public AutoCompletionForm(string initialFilter) { SetStyle( ControlStyles.OptimizedDoubleBuffer | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true); InitializeComponent(); // Style the control OlvStyler.StyleIt(fastOLV, StrEmptyList); fastOLV.DefaultRenderer = new FilteredItemTextRenderer(); // set the image list to use for the keywords Keyword.ImageGetter += rowObject => { var x = (CompletionItem)rowObject; if (x == null) { return(ImageResources.Error); } return(GetTypeImageFromStr(x.Type.ToString())); }; // decorate rows fastOLV.UseCellFormatEvents = true; fastOLV.FormatCell += FastOlvOnFormatCell; // we prevent further sorting fastOLV.BeforeSorting += FastOlvOnBeforeSorting; fastOLV.KeyDown += FastOlvOnKeyDown; fastOLV.UseTabAsInput = true; _filterByText = initialFilter.ToLower(); // handles mouse leave/mouse enter MouseLeave += CustomOnMouseLeave; fastOLV.MouseLeave += CustomOnMouseLeave; fastOLV.DoubleClick += FastOlvOnDoubleClick; }