Gorgon
Show / Hide Table of Contents

Class GorgonFolderBrowser

A file folder browser.

Inheritance
object
MarshalByRefObject
Component
Control
ScrollableControl
ContainerControl
UserControl
GorgonFolderBrowser
Implements
IDropTarget
ISynchronizeInvoke
IWin32Window
IBindableComponent
IComponent
IDisposable
IContainerControl
Inherited Members
UserControl.ValidateChildren()
UserControl.ValidateChildren(ValidationConstraints)
UserControl.OnCreateControl()
UserControl.OnResize(EventArgs)
UserControl.OnMouseDown(MouseEventArgs)
UserControl.WndProc(ref Message)
UserControl.AutoSize
UserControl.AutoSizeMode
UserControl.AutoValidate
UserControl.BorderStyle
UserControl.CreateParams
UserControl.DefaultSize
UserControl.AutoSizeChanged
UserControl.AutoValidateChanged
UserControl.Load
ContainerControl.AdjustFormScrollbars(bool)
ContainerControl.OnAutoValidateChanged(EventArgs)
ContainerControl.OnFontChanged(EventArgs)
ContainerControl.OnLayout(LayoutEventArgs)
ContainerControl.OnParentChanged(EventArgs)
ContainerControl.PerformAutoScale()
ContainerControl.ProcessDialogChar(char)
ContainerControl.ProcessDialogKey(Keys)
ContainerControl.ProcessCmdKey(ref Message, Keys)
ContainerControl.ProcessMnemonic(char)
ContainerControl.ProcessTabKey(bool)
ContainerControl.Select(bool, bool)
ContainerControl.UpdateDefaultButton()
ContainerControl.Validate()
ContainerControl.Validate(bool)
ContainerControl.AutoScaleDimensions
ContainerControl.AutoScaleFactor
ContainerControl.AutoScaleMode
ContainerControl.BindingContext
ContainerControl.CanEnableIme
ContainerControl.ActiveControl
ContainerControl.CurrentAutoScaleDimensions
ContainerControl.ParentForm
ScrollableControl.ScrollStateAutoScrolling
ScrollableControl.ScrollStateHScrollVisible
ScrollableControl.ScrollStateVScrollVisible
ScrollableControl.ScrollStateUserHasScrolled
ScrollableControl.ScrollStateFullDrag
ScrollableControl.GetScrollState(int)
ScrollableControl.OnMouseWheel(MouseEventArgs)
ScrollableControl.OnRightToLeftChanged(EventArgs)
ScrollableControl.OnPaintBackground(PaintEventArgs)
ScrollableControl.OnPaddingChanged(EventArgs)
ScrollableControl.OnVisibleChanged(EventArgs)
ScrollableControl.ScaleControl(SizeF, BoundsSpecified)
ScrollableControl.SetDisplayRectLocation(int, int)
ScrollableControl.ScrollControlIntoView(Control)
ScrollableControl.ScrollToControl(Control)
ScrollableControl.OnScroll(ScrollEventArgs)
ScrollableControl.SetAutoScrollMargin(int, int)
ScrollableControl.SetScrollState(int, bool)
ScrollableControl.AutoScroll
ScrollableControl.AutoScrollMargin
ScrollableControl.AutoScrollPosition
ScrollableControl.AutoScrollMinSize
ScrollableControl.DisplayRectangle
ScrollableControl.HScroll
ScrollableControl.HorizontalScroll
ScrollableControl.VScroll
ScrollableControl.VerticalScroll
ScrollableControl.Scroll
Control.GetAccessibilityObjectById(int)
Control.SetAutoSizeMode(AutoSizeMode)
Control.GetAutoSizeMode()
Control.GetPreferredSize(Size)
Control.AccessibilityNotifyClients(AccessibleEvents, int)
Control.AccessibilityNotifyClients(AccessibleEvents, int, int)
Control.BeginInvoke(Delegate)
Control.BeginInvoke(Delegate, params object[])
Control.BringToFront()
Control.Contains(Control)
Control.CreateAccessibilityInstance()
Control.CreateControlsInstance()
Control.CreateGraphics()
Control.CreateHandle()
Control.CreateControl()
Control.DefWndProc(ref Message)
Control.DestroyHandle()
Control.DoDragDrop(object, DragDropEffects)
Control.DrawToBitmap(Bitmap, Rectangle)
Control.EndInvoke(IAsyncResult)
Control.FindForm()
Control.GetTopLevel()
Control.RaiseKeyEvent(object, KeyEventArgs)
Control.RaiseMouseEvent(object, MouseEventArgs)
Control.Focus()
Control.FromChildHandle(IntPtr)
Control.FromHandle(IntPtr)
Control.GetChildAtPoint(Point, GetChildAtPointSkip)
Control.GetChildAtPoint(Point)
Control.GetContainerControl()
Control.GetScaledBounds(Rectangle, SizeF, BoundsSpecified)
Control.GetNextControl(Control, bool)
Control.GetStyle(ControlStyles)
Control.Hide()
Control.InitLayout()
Control.Invalidate(Region)
Control.Invalidate(Region, bool)
Control.Invalidate()
Control.Invalidate(bool)
Control.Invalidate(Rectangle)
Control.Invalidate(Rectangle, bool)
Control.Invoke(Delegate)
Control.Invoke(Delegate, params object[])
Control.InvokePaint(Control, PaintEventArgs)
Control.InvokePaintBackground(Control, PaintEventArgs)
Control.IsKeyLocked(Keys)
Control.IsInputChar(char)
Control.IsInputKey(Keys)
Control.IsMnemonic(char, string)
Control.LogicalToDeviceUnits(int)
Control.LogicalToDeviceUnits(Size)
Control.ScaleBitmapLogicalToDevice(ref Bitmap)
Control.NotifyInvalidate(Rectangle)
Control.InvokeOnClick(Control, EventArgs)
Control.OnAutoSizeChanged(EventArgs)
Control.OnBackColorChanged(EventArgs)
Control.OnBackgroundImageChanged(EventArgs)
Control.OnBackgroundImageLayoutChanged(EventArgs)
Control.OnBindingContextChanged(EventArgs)
Control.OnCausesValidationChanged(EventArgs)
Control.OnContextMenuChanged(EventArgs)
Control.OnContextMenuStripChanged(EventArgs)
Control.OnCursorChanged(EventArgs)
Control.OnDockChanged(EventArgs)
Control.OnEnabledChanged(EventArgs)
Control.OnForeColorChanged(EventArgs)
Control.OnNotifyMessage(Message)
Control.OnParentBackColorChanged(EventArgs)
Control.OnParentBackgroundImageChanged(EventArgs)
Control.OnParentBindingContextChanged(EventArgs)
Control.OnParentCursorChanged(EventArgs)
Control.OnParentEnabledChanged(EventArgs)
Control.OnParentFontChanged(EventArgs)
Control.OnParentForeColorChanged(EventArgs)
Control.OnParentRightToLeftChanged(EventArgs)
Control.OnParentVisibleChanged(EventArgs)
Control.OnPrint(PaintEventArgs)
Control.OnTabIndexChanged(EventArgs)
Control.OnTabStopChanged(EventArgs)
Control.OnTextChanged(EventArgs)
Control.OnClick(EventArgs)
Control.OnClientSizeChanged(EventArgs)
Control.OnControlAdded(ControlEventArgs)
Control.OnControlRemoved(ControlEventArgs)
Control.OnHandleCreated(EventArgs)
Control.OnLocationChanged(EventArgs)
Control.OnHandleDestroyed(EventArgs)
Control.OnDoubleClick(EventArgs)
Control.OnDragEnter(DragEventArgs)
Control.OnDragOver(DragEventArgs)
Control.OnDragLeave(EventArgs)
Control.OnDragDrop(DragEventArgs)
Control.OnGiveFeedback(GiveFeedbackEventArgs)
Control.OnEnter(EventArgs)
Control.InvokeGotFocus(Control, EventArgs)
Control.OnGotFocus(EventArgs)
Control.OnHelpRequested(HelpEventArgs)
Control.OnInvalidated(InvalidateEventArgs)
Control.OnKeyDown(KeyEventArgs)
Control.OnKeyPress(KeyPressEventArgs)
Control.OnKeyUp(KeyEventArgs)
Control.OnLeave(EventArgs)
Control.InvokeLostFocus(Control, EventArgs)
Control.OnLostFocus(EventArgs)
Control.OnMarginChanged(EventArgs)
Control.OnMouseDoubleClick(MouseEventArgs)
Control.OnMouseClick(MouseEventArgs)
Control.OnMouseCaptureChanged(EventArgs)
Control.OnMouseEnter(EventArgs)
Control.OnMouseLeave(EventArgs)
Control.OnDpiChangedBeforeParent(EventArgs)
Control.OnDpiChangedAfterParent(EventArgs)
Control.OnMouseHover(EventArgs)
Control.OnMouseMove(MouseEventArgs)
Control.OnMouseUp(MouseEventArgs)
Control.OnMove(EventArgs)
Control.OnPaint(PaintEventArgs)
Control.OnQueryContinueDrag(QueryContinueDragEventArgs)
Control.OnRegionChanged(EventArgs)
Control.OnPreviewKeyDown(PreviewKeyDownEventArgs)
Control.OnSizeChanged(EventArgs)
Control.OnChangeUICues(UICuesEventArgs)
Control.OnStyleChanged(EventArgs)
Control.OnSystemColorsChanged(EventArgs)
Control.OnValidating(CancelEventArgs)
Control.OnValidated(EventArgs)
Control.RescaleConstantsForDpi(int, int)
Control.PerformLayout()
Control.PerformLayout(Control, string)
Control.PointToClient(Point)
Control.PointToScreen(Point)
Control.PreProcessMessage(ref Message)
Control.PreProcessControlMessage(ref Message)
Control.ProcessKeyEventArgs(ref Message)
Control.ProcessKeyMessage(ref Message)
Control.ProcessKeyPreview(ref Message)
Control.RaiseDragEvent(object, DragEventArgs)
Control.RaisePaintEvent(object, PaintEventArgs)
Control.RecreateHandle()
Control.RectangleToClient(Rectangle)
Control.RectangleToScreen(Rectangle)
Control.ReflectMessage(IntPtr, ref Message)
Control.Refresh()
Control.ResetMouseEventArgs()
Control.ResetText()
Control.ResumeLayout()
Control.ResumeLayout(bool)
Control.Scale(SizeF)
Control.Select()
Control.SelectNextControl(Control, bool, bool, bool, bool)
Control.SendToBack()
Control.SetBounds(int, int, int, int)
Control.SetBounds(int, int, int, int, BoundsSpecified)
Control.SetBoundsCore(int, int, int, int, BoundsSpecified)
Control.SetClientSizeCore(int, int)
Control.SizeFromClientSize(Size)
Control.SetStyle(ControlStyles, bool)
Control.SetTopLevel(bool)
Control.SetVisibleCore(bool)
Control.RtlTranslateAlignment(HorizontalAlignment)
Control.RtlTranslateAlignment(LeftRightAlignment)
Control.RtlTranslateAlignment(ContentAlignment)
Control.RtlTranslateHorizontal(HorizontalAlignment)
Control.RtlTranslateLeftRight(LeftRightAlignment)
Control.RtlTranslateContent(ContentAlignment)
Control.Show()
Control.SuspendLayout()
Control.Update()
Control.UpdateBounds()
Control.UpdateBounds(int, int, int, int)
Control.UpdateBounds(int, int, int, int, int, int)
Control.UpdateZOrder()
Control.UpdateStyles()
Control.OnImeModeChanged(EventArgs)
Control.AccessibilityObject
Control.AccessibleDefaultActionDescription
Control.AccessibleDescription
Control.AccessibleName
Control.AccessibleRole
Control.AllowDrop
Control.Anchor
Control.AutoScrollOffset
Control.LayoutEngine
Control.BackgroundImage
Control.BackgroundImageLayout
Control.Bottom
Control.Bounds
Control.CanFocus
Control.CanRaiseEvents
Control.CanSelect
Control.Capture
Control.CausesValidation
Control.CheckForIllegalCrossThreadCalls
Control.ClientRectangle
Control.ClientSize
Control.CompanyName
Control.ContainsFocus
Control.ContextMenu
Control.ContextMenuStrip
Control.Controls
Control.Created
Control.Cursor
Control.DataBindings
Control.DefaultBackColor
Control.DefaultCursor
Control.DefaultFont
Control.DefaultForeColor
Control.DefaultMargin
Control.DefaultMaximumSize
Control.DefaultMinimumSize
Control.DefaultPadding
Control.DeviceDpi
Control.IsDisposed
Control.Disposing
Control.Dock
Control.DoubleBuffered
Control.Enabled
Control.Focused
Control.Font
Control.FontHeight
Control.ForeColor
Control.Handle
Control.HasChildren
Control.Height
Control.IsHandleCreated
Control.InvokeRequired
Control.IsAccessible
Control.IsMirrored
Control.Left
Control.Location
Control.Margin
Control.MaximumSize
Control.MinimumSize
Control.ModifierKeys
Control.MouseButtons
Control.MousePosition
Control.Name
Control.Parent
Control.ProductName
Control.ProductVersion
Control.RecreatingHandle
Control.Region
Control.RenderRightToLeft
Control.ResizeRedraw
Control.Right
Control.RightToLeft
Control.ScaleChildren
Control.Site
Control.Size
Control.TabIndex
Control.TabStop
Control.Tag
Control.Top
Control.TopLevelControl
Control.ShowKeyboardCues
Control.ShowFocusCues
Control.UseWaitCursor
Control.Visible
Control.Width
Control.PreferredSize
Control.Padding
Control.DefaultImeMode
Control.ImeMode
Control.ImeModeBase
Control.PropagatingImeMode
Control.BackColorChanged
Control.BackgroundImageChanged
Control.BackgroundImageLayoutChanged
Control.BindingContextChanged
Control.CausesValidationChanged
Control.ClientSizeChanged
Control.ContextMenuChanged
Control.ContextMenuStripChanged
Control.CursorChanged
Control.DockChanged
Control.EnabledChanged
Control.FontChanged
Control.ForeColorChanged
Control.LocationChanged
Control.MarginChanged
Control.RegionChanged
Control.RightToLeftChanged
Control.SizeChanged
Control.TabIndexChanged
Control.TabStopChanged
Control.TextChanged
Control.VisibleChanged
Control.Click
Control.ControlAdded
Control.ControlRemoved
Control.DragDrop
Control.DragEnter
Control.DragOver
Control.DragLeave
Control.GiveFeedback
Control.HandleCreated
Control.HandleDestroyed
Control.HelpRequested
Control.Invalidated
Control.PaddingChanged
Control.Paint
Control.QueryContinueDrag
Control.QueryAccessibilityHelp
Control.DoubleClick
Control.Enter
Control.GotFocus
Control.KeyDown
Control.KeyPress
Control.KeyUp
Control.Layout
Control.Leave
Control.LostFocus
Control.MouseClick
Control.MouseDoubleClick
Control.MouseCaptureChanged
Control.MouseDown
Control.MouseEnter
Control.MouseLeave
Control.DpiChangedBeforeParent
Control.DpiChangedAfterParent
Control.MouseHover
Control.MouseMove
Control.MouseUp
Control.MouseWheel
Control.Move
Control.PreviewKeyDown
Control.Resize
Control.ChangeUICues
Control.StyleChanged
Control.SystemColorsChanged
Control.Validating
Control.Validated
Control.ParentChanged
Control.ImeModeChanged
Component.Dispose()
Component.GetService(Type)
Component.ToString()
Component.Events
Component.Container
Component.DesignMode
Component.Disposed
MarshalByRefObject.MemberwiseClone(bool)
MarshalByRefObject.GetLifetimeService()
MarshalByRefObject.InitializeLifetimeService()
MarshalByRefObject.CreateObjRef(Type)
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
Namespace: Gorgon.UI
Assembly: Gorgon.Windows.dll
Syntax
public class GorgonFolderBrowser : UserControl, IDropTarget, ISynchronizeInvoke, IWin32Window, IBindableComponent, IComponent, IDisposable, IContainerControl
Remarks

This control is meant as a drop in component to allow for easy selection of file folders on a drive. This can be considered a replacement for the built-in .NET folder browser dialog as the UI for this control is much easier to navigate around.

The control is patterned after the FileDialogBrowser control, but without needing to have a file name. It is also more customizable allowing users to supply their own icons for folders and drive types.

Constructors

| Edit this page View Source

GorgonFolderBrowser()

Initializes a new instance of the GorgonFolderBrowser class.

Declaration
public GorgonFolderBrowser()

Properties

| Edit this page View Source

BackColor

Property to set or return the background color.

Declaration
[Browsable(true)]
public Color BackColor { get; set; }
Property Value
Type Description
Color
| Edit this page View Source

CaptionFont

Property to set or return the font to use for the caption.

Declaration
[Browsable(true)]
public Font CaptionFont { get; set; }
Property Value
Type Description
Font
| Edit this page View Source

CdRomImage

Property to set or return the image to use as the icon for a hard drive.

Declaration
[Browsable(true)]
public Image CdRomImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

CurrentDirectory

Property to return the current directory.

Declaration
[Browsable(false)]
public string CurrentDirectory { get; }
Property Value
Type Description
string
| Edit this page View Source

DirectoryImage

Property to set or return the image to use as the icon for a directory.

Declaration
[Browsable(true)]
public Image DirectoryImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

DirectoryListFont

Property to set or return the font to use for the directory list items.

Declaration
[Browsable(true)]
public Font DirectoryListFont { get; set; }
Property Value
Type Description
Font
| Edit this page View Source

DirectoryNameFont

Property to set or return the font to use for the directory name text box.

Declaration
[Browsable(true)]
public Font DirectoryNameFont { get; set; }
Property Value
Type Description
Font
| Edit this page View Source

DirectorySeparator

Property to set or return the character to use as the directory separator.

Declaration
[Browsable(false)]
public char DirectorySeparator { get; set; }
Property Value
Type Description
char
| Edit this page View Source

FileImage

Property to set or return the image to use as the icon for a directory.

Declaration
[Browsable(true)]
public Image FileImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

HardDriveImage

Property to set or return the image to use as the icon for a hard drive.

Declaration
[Browsable(true)]
public Image HardDriveImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

IsDesignTime

Property to return whether or not the control is in design mode.

Declaration
[Browsable(false)]
public bool IsDesignTime { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsErrorPaneOpen

Property to return whether or not the error pane is open on the control.

Declaration
[Browsable(false)]
public bool IsErrorPaneOpen { get; }
Property Value
Type Description
bool
| Edit this page View Source

IsReadOnly

Property to set or return whether the browser is in read only mode.

Declaration
[Browsable(true)]
public bool IsReadOnly { get; set; }
Property Value
Type Description
bool
| Edit this page View Source

NetworkDriveImage

Property to set or return the image to use as the icon for a hard drive.

Declaration
[Browsable(true)]
public Image NetworkDriveImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

RamDriveImage

Property to set or return the image to use as the icon for a hard drive.

Declaration
[Browsable(true)]
public Image RamDriveImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

RemovableDriveImage

Property to set or return the image to use as the icon for a hard drive.

Declaration
[Browsable(true)]
public Image RemovableDriveImage { get; set; }
Property Value
Type Description
Image
Remarks

If this value is null, the image used will be the default for the operating system.

| Edit this page View Source

RootFolder

Property to set or return the folder that should be used as the root of the file system.

Declaration
[Browsable(false)]
public DirectoryInfo RootFolder { get; set; }
Property Value
Type Description
DirectoryInfo
| Edit this page View Source

Text

Gets or sets the text associated with this control.

Declaration
[Browsable(true)]
[Bindable(false)]
public string Text { get; set; }
Property Value
Type Description
string

Methods

| Edit this page View Source

AssignInitialDirectory(DirectoryInfo)

Function to set the initial directory.

Declaration
public void AssignInitialDirectory(DirectoryInfo dir)
Parameters
Type Name Description
DirectoryInfo dir

The directory to assign.

| Edit this page View Source

Dispose(bool)

Clean up any resources being used.

Declaration
protected override void Dispose(bool disposing)
Parameters
Type Name Description
bool disposing

true if managed resources should be disposed; otherwise, false.

Overrides
ContainerControl.Dispose(bool)
| Edit this page View Source

OnLoad(EventArgs)

Raises the Load event.

Declaration
protected override void OnLoad(EventArgs e)
Parameters
Type Name Description
EventArgs e

An EventArgs that contains the event data.

Overrides
UserControl.OnLoad(EventArgs)
| Edit this page View Source

SetErrorMessage(string)

Function to show an error message for the folder selector.

Declaration
public void SetErrorMessage(string message)
Parameters
Type Name Description
string message

The message to display.

Remarks

Passing null, or an empty string to the message parameter will reset and hide the message bar on the control.

Events

| Edit this page View Source

FolderAdding

Event triggered when a folder is about to be created on the file system.

Declaration
public event EventHandler<FolderAddArgs> FolderAdding
Event Type
Type Description
EventHandler<FolderAddArgs>
| Edit this page View Source

FolderDeleting

Event triggered when a folder is about to be deleted from the file system.

Declaration
public event EventHandler<FolderDeleteArgs> FolderDeleting
Event Type
Type Description
EventHandler<FolderDeleteArgs>
| Edit this page View Source

FolderEntered

Event triggered when a folder is entered.

Declaration
public event EventHandler<FolderSelectedArgs> FolderEntered
Event Type
Type Description
EventHandler<FolderSelectedArgs>
| Edit this page View Source

FolderRenaming

Event triggered when a folder is about to be renamed on the file system.

Declaration
public event EventHandler<FolderRenameArgs> FolderRenaming
Event Type
Type Description
EventHandler<FolderRenameArgs>
| Edit this page View Source

FolderSelected

Event triggered when a folder is selected.

Declaration
public event EventHandler<FolderSelectedArgs> FolderSelected
Event Type
Type Description
EventHandler<FolderSelectedArgs>

Implements

IDropTarget
ISynchronizeInvoke
IWin32Window
IBindableComponent
IComponent
IDisposable
IContainerControl

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
GorgonControlExtensions.GetAncestor<T>(Control)
GorgonControlExtensions.GetFirstAncestor<T>(Control)
GorgonControlExtensions.GetForm<T>(Control)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author