Class

DesktopChart


Description

Displays data you provide in chart form of various types.

Methods

Name

Parameters

Returns

Shared

AcceptFileDrop

FileType As String

AcceptPictureDrop

AcceptRawDataDrop

Type As String

AcceptTextDrop

AddDataset

dataset As ChartDataset

AddDatasetAt

index As Integer, Dataset As ChartDataset

AddDatasets

Datasets() As ChartDataset

AddLabel

name As String

AddLabelAt

index As String, name As String

AddLabels

names() As String

Close

DatasetAt

index As Integer

ChartDataset

DataSets

Iterable

DrawInto

g As Graphics, x As Integer, y As Integer

LabelAt

index As Integer

String

Labels

Iterable

Refresh

immediately As Boolean = False

x As Integer, y As Integer, width As Integer, height As Integer, immediately As Boolean = False

RemoveAllDatasets

RemoveAllLabels

RemoveDatasetAt

index As Integer

RemoveLabelAt

index As Integer

Scroll

dx As Integer, dy As Integer, x As Integer = 0, y As Integer = 0, width As Integer = -10000, height As Integer = -10000, moveControls As Boolean = True

SetFocus

Enumerations

DesktopChart.Modes

Modes

The various types of charts available.

Enum

Bar

Bubble

Doughnut

Line

Pie

PolarArea

Radar

Scatter

Stacked

Property descriptions


Desktopchart.Active

Active As Boolean

Indicates whether the DesktopChart is active.

This property is read-only.

Active is False when the control's window is not in the foreground. When a DesktopWindow is deactivated, its controls are automatically deactivated unless AllowAutoDeactivate is set to False.


DesktopChart.AllowAutoDeactivate

AllowAutoDeactivate As Boolean

Determines whether the control should be deactivated (on macOS) when the parent window is deactivated. The default is True.


DesktopChart.AllowFocus

AllowFocus As Boolean

If True, the DesktopChart will be included in the Tab order and can accept the focus. The FocusReceived and FocusLost events are called at the appropriate times.

This code enables the AllowFocus property. It is in the Opening event of the control.

Me.AllowFocus = True

DesktopChart.AllowFocusRing

AllowFocusRing As Boolean

If True, the DesktopChart indicates that it has the focus with a ring around its border; if False, the appearance of the object does not change when it has the focus.

Setting this property to True has no effect on Windows or Linux. The default is True.

This code turns AllowFocusRing off.

Me.AllowFocusRing = False

DesktopChart.AllowPopover

AllowPopover As Boolean

If True, a popover will be displayed when the user positions the mouse over items that have additional information.

The default value is True.


DesktopChart.AllowTabs

AllowTabs As Boolean

If True and AllowFocus is True, then pressing Tab triggers the KeyDown event for processing. The default is False.

If False, pressing the Tab key does not trigger the KeyDown event; pressing Tab triggers the FocusLost Event and selects the next object in the window that can accept the focus.

The following turns on AllowTabs.

Me.AllowTabs = True

DesktopChart.AllowTabStop

AllowTabStop As Boolean

If True, the control is in the Tab Order and accepts the focus when the user tabs into it. The default is True. If False, the user cannot tab into it to give it the focus. However, the control can gain the focus by other means, such as the user's clicking on it or by setting the focus in code.

This example removes the control from the Tab Order:

Me.AllowTabStop = False

DesktopChart.AutoCalculateYAxis

AutoCalculateYAxis As Boolean

If True, the Y axis for Line and Bar charts will start at 0.

This property is True by default.


DesktopChart.Backdrop

Backdrop As Picture

The passed Picture that will automatically be drawn behind the chart data.

The following code assigns a jpg image to the Backdrop. The image has been added to the project. The code is in the Opening event.

Me.BackDrop = HouseImage

DesktopChart.BackgroundColor

BackgroundColor As ColorGroup

The color of the background of the chart.


DesktopChart.DatasetCount

DatasetCount As Integer

The number of datasets that have been added to the chart.

This property is read-only.


DesktopChart.DatasetLastIndex

DatasetLastIndex As Integer

The index of last dataset added to the chart.

This property is read-only.


DesktopChart.Enabled

Enabled As Boolean

When True the control is drawn enabled and responds to user action. When False, the control appears as disabled and does not respond to user actions.


DesktopChart.FontName

FontName As String

Name of the font used to display the text content.

You can enter any font that is installed on the computer or the names of the two metafonts, "System" and "SmallSystem".

The System font is the font used by the system software as its default font. Different operating systems use different default fonts. If the system software supports both a large and small System font, you can also specify the "SmallSystem" font as your FontName.

On macOS, "SmallSystem" specifies the OS's smaller system font and may make the control smaller in size as well. On Windows and Linux, "SmallSystem" is the same as "System".

This code sets the FontName property.

Me.FontName = "Helvetica"

DesktopChart.FontSize

FontSize As Double

Point size of the font used to display the caption.

If you enter zero as the FontSize, your app will use the font size that works best for the platform on which it is running.

This code sets the font size to 16 points.

Me.FontSize = 16

DesktopChart.Format

Format As String

Used to format axis values.

It uses the same formatting conventions as the Format function.


DesktopChart.GridColor

GridColor As ColorGroup

The color of the chart's grid.


DesktopChart.Handle

Handle As Ptr

Returns a handle to the control.

This property is read-only.

For interfacing with Mac APIs using Declares, DesktopControl.Handle returns NSViews (except for DesktopToolbar).

On Windows returns the HWND of the control.

On Linux it returns a GtkWidget.

The following gets a handle to the control.

Var p As Ptr = Me.Handle

DesktopChart.HasLegend

HasLegend As Boolean

If True, the chart's legend will be displayed.


DesktopChart.Height

Height As Integer

The height (in points) of the control.


DesktopChart.Index

Index As Integer

If the control is used in a control set, this specifies the control's index in the set.

This property is read-only.


DesktopChart.LabelCount

LabelCount As Integer

The number of labels in the chart.

This property is read-only.


DesktopChart.LabelLastIndex

LabelLastIndex As Integer

The index of last label added to the chart.

This property is read-only.


DesktopChart.Left

Left As Integer

The position of the left side of the control in pixels, relative to the window.


DesktopChart.LegendColor

TextColor As ColorGroup

Gets or sets the color of the legend. The default value is black.

The following example sets the LegendColor.

Me.LegendColor = Color.Red

DesktopChart.LegendFontName

TitleFontName As String

Name of the font used to display the chart legend.

You can enter any font that is installed on the computer or the names of the two metafonts, "System" and "SmallSystem".

The System font is the font used by the system software as its default font. Different operating systems use different default fonts. If the system software supports both a large and small System font, you can also specify the "SmallSystem" font as your FontName.

On macOS, "SmallSystem" specifies the OS's smaller system font and may make the control smaller in size as well. On Windows and Linux, "SmallSystem" is the same as "System".

This code sets the FontName property.

Me.LegendFontName = "Helvetica"

DesktopChart.LegendFontSize

LegendFontSize As Double

Point size of the font used to display the legend.

If you enter zero as the FontSize, your app will use the font size that works best for the platform on which it is running.

This code sets the font size to 16 points.

Me.LegendFontSize = 16

DesktopChart.LockBottom

LockBottom As Boolean

Determines whether the bottom edge of the control should stay at a set distance from the bottom edge of the parent control, if there is one, or the owning window.

This property is read-only.


DesktopChart.LockLeft

LockLeft As Boolean

Determines whether the left edge of the control should stay at a set distance from the left edge of the parent control, if there is one, or the owning window.

This property is read-only.


DesktopChart.LockRight

LockRight As Boolean

Determines whether the right edge of the control should stay at a set distance from the right edge of the parent control, if there is one, or the owning window.

This property is read-only.


DesktopChart.LockTop

LockTop As Boolean

Determines whether the top edge of the control should stay at a set distance from the top edge of the parent control, if there is one, or the owning window.

This property is read-only.


DesktopChart.Mode

Mode As Modes

Indicates the type of chart the control is currently displaying.

Labels are required for a Bar chart to draw.

This example checks the mode of the chart:

If Chart1.Mode = DesktopChart.Modes.Bar then
  Chart1.Title = "Sales Bar Chart"
End If

DesktopChart.MouseCursor

MouseCursor As MouseCursor

The cursor to be displayed while the mouse is within the control and both the DesktopApplication and DesktopWindow class's MouseCursor properties are Nil.

If the DesktopApplication class's MouseCursor property is not Nil or the DesktopWindow's MouseCursor property is not Nil, then any control's MouseCursor property is ignored. You can use a cursor stored in the Cursors module. On Macintosh, you can also obtain a MouseCursor from a resource file.

This line in the Opening event of the control sets the default cursor to the finger pointer.

Me.MouseCursor = System.Cursors.FingerPointer

DesktopChart.Name

Name As String

The name of the control.

This property is read-only.


DesktopChart.PanelIndex

PanelIndex As Integer

If the control has been placed on a DesktopTabPanel or DesktopPagePanel control, this is the panel (page/tab) that the control is on. If the control is not on a panel, it returns -1.

The first panel is numbered zero. If the control has been placed on a panel of a DesktopTabPanel or DesktopPagePanel control, it returns the panel number. If the control is not on a DesktopPagePanel or DesktopTabPanel, it returns -1. If you change the PanelIndex to a nonexistent panel, the control will disappear until you give it a PanelIndex value that corresponds to a panel that exists.

If you are looking to change the currently selected panel (page/tab), use DesktopPagePanel.

This code displays the panel index of the control that is on the page.

MessageBox(Me.SelectedPanelIndex.ToString)

DesktopChart.Parent

Parent As Object

Used to get the control's parent control or page. If the parent control is a DesktopContainer, then it returns the DesktopContainer. If it is on a DesktopWindow, it returns the DesktopWindow.

This property is read-only.


DesktopChart.PopoverBackgroundColor

PopoverBackgroundColor As ColorGroup

The background color of the chart's popover.


DesktopChart.PopoverTextColor

PopoverTextColor As ColorGroup

The color of text in the chart's popover.


DesktopChart.ScaleFactor

ScaleFactor As Double

The scale factor used when converting user space coordinates to backing store coordinates for the DesktopChart.


DesktopChart.Scope

Scope As Integer

Used to determine whether access to the control is Public (0) or Private (2). The default is Public.

This property is read-only.

Note

This is a designtime-only property and thus can only be set in the Inspector and is not accessible via code.

If the Scope of a control is set to Private, it cannot be accessed from outside its parent window.


DesktopChart.TabIndex

TabIndex As Integer

The control's position in the Tab Order. The control with a TabIndex of 0 is the first control to get the focus when the window opens.

This example sets the control's TabIndex.

Me.TabIndex = 2

DesktopChart.TitleColor

TitleColor As ColorGroup

Gets or sets the color of the title. The default value is black.

The following example sets the TitleColor.

Me.TitleColor = Color.Red

DesktopChart.TextColor

TextColor As ColorGroup

Gets or sets the color of the text. The default value is black.

The following example sets the TextColor.

Me.TextColor = Color.Red

DesktopChart.Title

Title As String

The title of the chart.


DesktopChart.TitleFontName

TitleFontName As String

Name of the font used to display the chart title.

You can enter any font that is installed on the computer or the names of the two metafonts, "System" and "SmallSystem".

The System font is the font used by the system software as its default font. Different operating systems use different default fonts. If the system software supports both a large and small System font, you can also specify the "SmallSystem" font as your FontName.

On macOS, "SmallSystem" specifies the OS's smaller system font and may make the control smaller in size as well. On Windows and Linux, "SmallSystem" is the same as "System".

This code sets the FontName property.

Me.TitleFontName = "Helvetica"

DesktopChart.TitleFontSize

TitleFontSize As Double

Point size of the font used to display the title.

If you enter zero as the FontSize, your app will use the font size that works best for the platform on which it is running.

This code sets the font size to 16 points.

Me.TitleFontSize = 16

DesktopChart.Tooltip

Tooltip As String

Text of a message displayed as a tooltip.

The tip is displayed when the user places the mouse on the control and leaves it there.

This code in the Opening event of a Button sets the tooltip:

Me.Tooltip = "Save changes"

DesktopChart.Top

Top As Integer

The top of the control in local coordinates relative to the window.


DesktopChart.Transparent

Transparent As Boolean

Determines whether the control is transparent on Windows. The default is False. Has no effect on macOS or Linux.

Transparent controls draw more slowly and use more memory in order to cache the background. Unless you absolutely require transparency, leave this set to False.

For projects that were created prior to 2018r1, this property defaults to True to emulate previous behavior. Consider changing it to False to improve performance if you do not require transparency.


DesktopChart.Visible

Visible As Boolean

If True, the control is drawn. If False, it's not.

Hide a control based on a checkbox setting:

If ShowEmailCheckbox.Value Then
  EmailField.Visible = True
Else
  EmailField.Visible = False
End If

DesktopChart.Width

Width As Integer

The width (in points) of the control.

This code in the Shown event handler increases the size of the control:

Me.Width = Me.Width + 50

DesktopChart.Window

Window As DesktopWindow

The control's parent window.

This property is read-only.

This code gets the parent window's Title property.

MessageBox(Me.Window.Title)

Method descriptions


DesktopChart.AcceptFileDrop

AcceptFileDrop(FileType As String)

Permits documents of type FileType to be dropped on the control. FileType must be a file type that you defined in via the FileType class or the File Type Sets Editor.

This code in the Opening event makes it possible for the user to drop either a picture or a file that is a jpeg image. The File Type Sets editor was used to define the “image/jpeg” file type. It is one of the “Common File Types” that is available in the editor.

Me.AcceptPictureDrop
Me.AcceptFileDrop("image/jpeg")

To restrict file drops to just folders (and not files), you can put this code in the DragEnter event:

If Not obj.FolderItem.IsFolder Then Return True

DesktopChart.AcceptPictureDrop

AcceptPictureDrop

Permits pictures to be dropped on the control.

If a control should accept pictures in a drag and drop, then AcceptPictureDrop needs to be called prior to the drop. Typically, it is in the Opening event of the control itself. For example, the line:

Me.AcceptPictureDrop

in the Opening event of the control that will receive the dragged pictures is needed. When the picture is dropped, the DropObject event is called and this is where you will put your code to handle the drop.

Opening Event:

Me.AcceptPictureDrop

DropObject Event:

If obj.PictureAvailable Then
  Me.Backdrop = obj.Picture
End If

DesktopChart.AcceptRawDataDrop

AcceptRawDataDrop(Type As String)

Permits data (of the Type specified) to be dropped on the control.

The following specfies a generic file type defined in the File Type Sets editor.

Me.AcceptRawDataDrop("????")

DesktopChart.AcceptTextDrop

AcceptTextDrop

Permits text to be dropped on the control.

This line in the Opening event of a control that can accept dragged text.

Me.AcceptTextDrop

DesktopChart.AddDataset

AddDataset(dataset As ChartDataset)

Adds the dataset to the chart. Incompatible datasets are ignored.


DesktopChart.AddDatasetAt

AddDatasetAt(index As Integer, dataset As ChartDataset)

Adds the dataset to the chart at the index passed. Incompatible datasets are ignored.


DesktopChart.AddDatasets

AddDatasets(datasets() As ChartDataset)

Adds the array of datasets to the chart.


DesktopChart.AddLabel

AddLabel(name As String)

Adds the label to the chart.


DesktopChart.AddLabelAt

AddLabelAt(index As String, name As String)

Adds the label to the chart at the index passed.


DesktopChart.AddLabels

AddLabels(names() As String)

Adds the array of labels to the chart.


DesktopChart.Close

Close

Closes the control.


DesktopChart.DatasetAt

DatasetAt(index As Integer) As ChartDataset

Returns the ChartDataset at the index passed.


DesktopChart.DataSets

DataSets() As Iterable

Allows iterating through all data sets.


DesktopChart.DrawInto

DrawInto(g As Graphics, x As Integer, y As Integer)

Draws the contents of the control into the specified Graphics context. The parameters x and y are the coordinates of the top, left corner.

Note

DrawInto will only work if the control is on a window or container.

This example draws the current control into the Graphics of a Picture and then displays it as the Backdrop of the DesktopChart:

Var p As New Picture(Me.Width, Me.Height)
Me.DrawInto(p.Graphics, 0, 0)
Chart1.Backdrop = p

DesktopChart.LabelAt

LabelAt(index As Integer) As String

Returns the label at the index passed.


DesktopChart.Labels

Labels() As Iterable

Allows iterating through all labels.


DesktopChart.Refresh

Refresh(immediately As Boolean = False)

Redraws the portion specified of the contents of the control the next time the OS redraws the control or immediately if True is passed.

If you are calling this so frequently that you experience a slowdown in your code, pass True for the immediately parameter.

Calling this method causes the Render event to fire.

Refresh the entire area immediately:

Me.Refresh(True)

DesktopChart.Refresh

Refresh(x As Integer, y As Integer, width As Integer, height As Integer, immediately As Boolean = False)

Redraws the portion specified of the contents of the control the next time the OS redraws the control or immediately if True is passed.

Refresh a portion of the area the next time the OS redraws the control:

Me.Refresh(100, 150, 200, 300)

DesktopChart.RemoveAllDatasets

RemoveAllDatasets

Removes all datasets from the chart.


DesktopChart.RemoveAllLabels

RemoveAllLabels

Removes all labels from the chart.


DesktopChart.RemoveDatasetAt

RemoveDatasetAt(index As Integer)

Removes the ChartDataset at the index passed.


DesktopChart.RemoveLabelAt

RemoveLabelAt(index As Integer)

Removes the label at the index passed.


DesktopChart.Scroll

Scroll(dx As Integer, dy As Integer, x As Integer = 0, y As Integer = 0, width As Integer = -10000, height As Integer = -10000, moveControls As Boolean = True)

Scrolls the DesktopChart contents according to the passed parameters.

dx and dy are the number of points to scroll horizontally and vertically relative to the current position of the picture in the DesktopChart control. Positive values scroll right and down while negative values scroll left and up. The x, y, width, and height parameters specify the portion of the picture to be scrolled. If these are not passed, the entire picture will be scrolled. moveControls indicates whether controls positioned on top of the DesktopChart control should be scrolled as well. moveControls is True by default.

To use the Scroll method to scroll the contents of a DesktopChart control, you need to store the last scroll value for the axis you are scrolling so you can use this to calculate the amount to scroll. This can be done by adding properties to the window that contains the DesktopChart control or by creating a new class based on the DesktopChart control that contains properties to hold the last X scroll amount and last Y scroll amount.

If the moveControls parameter is True, any controls on top of the DesktopChart control will also be scrolled. This allows the implementation of a scrolling pane of controls.

The following example scrolls a picture that was added to the project. The properties XScroll and YScroll have been added to the window to hold the amounts the picture has been scrolled. The picture is scrolled 8 points at a time. In the Keydown event of the window, the following code calls the Scroll method whenever the Up, Down, Left, or Right arrow keys are pressed.

Const LeftArrow = 28
Const RightArrow = 29
Const UpArrow = 30
Const DownArrow = 31
Const ScrollUnit = 8 ' points

Select Case Key.Asc
Case LeftArrow
  XScroll = XScroll + ScrollUnit
  Chart1.Scroll(ScrollUnit, 0)

Case RightArrow
  XScroll = XScroll - ScrollUnit
  Chart1.Scroll(-ScrollUnit, 0)

Case UpArrow
  YScroll = YScroll + ScrollUnit
  Chart1.Scroll(0, ScrollUnit)

Case DownArrow
  YScroll = YScroll - ScrollUnit
  Chart1.Scroll(0, -ScrollUnit)

End Select

DesktopChart.SetFocus

SetFocus

Sets the focus to the DesktopChart control.

Event descriptions


DesktopChart.Activated

Activated

The control is activated. In a single window interface, the Activate event fires when the parent window is activated. See the DesktopApplication and DesktopWindow Activate events.

This can be because the app is launched or a window belonging to another app is no longer frontmost (active). The Deactivate event fires when another window becomes active. In a single window interface, the Activate event fires when the window is activated, e.g., when the app first displays the window.


DesktopChart.Closing

Closing

The control is about to be removed from the window either because the window is closing or the control's Close method was called.


DesktopChart.ConstructContextualMenu

ConstructContextualMenu(base As DesktopMenuItem, x As Integer, y As Integer) As Boolean

This event is called when it is appropriate to display a contextual menu for the control.

This event handler is the recommended way to handle contextual menus because this event figures out whether the user has requested the contextual menu, regardless of how they did it. Depending on platform, it might be in the MouseUp or MouseDown event and it might be a right+click or by pressing the contextual menu key on the keyboard, for example.

Base is analogous to the menu bar for the contextual menu. Any items you add to Base will be shown as menu items. If you return False, the event is passed up the parent hierarchy.

If you return True, the contextual menu is displayed. The parameters x and y are the mouse locations. If the event was fired because of a non-mouse event, then x and y are both set to -1. See the example of a contextual menu in the following section.

The following ConstructContextualMenu event handler builds a menu with three menu items plus a submenu with three additional menu items.

' Add some items
base.AddMenu(New DesktopMenuItem("Test 1"))
base.AddMenu(New DesktopMenuItem("Test 2"))
base.AddMenu(New DesktopMenuItem("Test 3"))

' Add a Separator
base.AddMenu(New DesktopMenuItem(DesktopMenuItem.TextSeparator))

' Add a sub menu
Var submenu As New DesktopMenuItem("SubMenu")
submenu.AddMenu(New DesktopMenuItem("SubMenu Test 1"))
submenu.AddMenu(New DesktopMenuItem("SubMenu Test 2"))
submenu.AddMenu(New DesktopMenuItem("SubMenu Test 3"))
base.AddMenu(submenu)

' Add a Separator
base.AddMenu(New DesktopMenuItem(DesktopMenuItem.TextSeparator))

Return True

DesktopChart.ContextualMenuSelected

ContextualMenuSelected(selectedItem As DesktopMenuItem)

Called when selectedItem is chosen from a contextual menu.

This code populates a contextual menu in the Opening event of a Chart control:

Var menu As New DesktopMenuItem

menu.AddMenuItem("One")
menu.AddMenuItem("Two")
menu.AddMenuItem("Three")
Me.ContextualMenu = menu

The menu selection is then handled by the ContextualMenuSelected event when the user right-clicks on the control. For example, it can be of the form:

Select Case selectedItem.Text
Case "One"
  MessageBox("One")
Case "Two"
  MessageBox("Two")
Case "Three"
  MessageBox("Three")
End Select

DesktopChart.Deactivated

Deactivated

The DesktopChart is deactivated. See the DesktopApplication and DesktopWindow Deactivated events.

In a multiple window interface, the Deactivated event fires when the parent window is deactivated because another window has been brought to the front or a window belonging to another app becomes frontmost. In a single window app, the Deactivated event fires when a window belonging to another app becomes frontmost.


DesktopChart.DragEnter

DragEnter(obj As DragItem, Action As DragItem.Types) As Boolean

Fires when the passed DragItem enters the DesktopChart control.

Returns a Boolean. Return True from this event to prevent the drop from occurring.

The Action parameter specifies the type of drag action.

To restrict file drops to just folders (and not files), you can put this code in the DragEnter event:

If Not obj.FolderItem.IsFolder Then Return True

DesktopChart.DragExit

DragExit(obj As DragItem, Action As DragItem.Types)

Fires when the passed DragItem exits the DesktopChart control.

The Obj parameter is the item being dragged. The Action parameter specifies the type of drag action.


DesktopChart.DragOver

DragOver(x As Integer, y As Integer, obj As DragItem, Action As DragItem.Types) As Boolean

Fires when the DragItem is over the DesktopChart control.

The Obj parameter is the object being dragged. The coordinates x and y are relative to the DesktopChart. Returns a Boolean. Return True from this event to prevent the drop from occurring.

The Action parameter specifies the type of drag action, which is typically done by holding down a modifier key (Shift, Alt, Option, Command, etc.) while doing the drag.


DesktopChart.DropObject

DropObject(Obj As DragItem Action As DragItem.Types)

The item represented by Obj has been dropped on the control.

The Obj parameter is the object being dragged. The Action parameter specifies the type of drag action.

The following DropObject event handler can handle either a dropped picture or a dropped file. The type of file that it can handle needs to have been specified in a call to AcceptFileDrop prior to the drop, for example, in the Opening event.

If Obj.PictureAvailable Then
  Me.Image = obj.Picture
ElseIf Obj.FolderItemAvailable Then
  Me.Image = Picture.Open(obj.FolderItem)
End If

DesktopChart.Error

Error(DataSet As ChartDataSet)

The chart either has no room to display the data or is too small to draw the grid. The DataSet is the ChartDataSet assigned to the control.


DesktopChart.FocusLost

FocusLost

The control has lost the focus.

This property must be set to True for the control to be capable of getting then losing the focus.

Note

On macOS, controls other than text fields and lists will accept and lose focus only if the full keyboard access option is enabled in System Preferences/Keyboard.


DesktopChart.FocusReceived

FocusReceived

The control has received the focus and has a selection rectangle around it.

This property must be set to True for the control to be capable of getting the focus.

Note

On macOS, controls other than text fields and lists will accept focus only if the full keyboard access option is enabled in System Preferences/Keyboard.


DesktopChart.KeyDown

KeyDown(Key As String) As Boolean

The user has pressed the Key passed while the control has the focus.

How KeyDown works depends on the type of control.

Returning True means the key is intercepted, preventing the key from actually reaching the control at all. This would be useful if you want to override the behavior of the tab key for example. Returning False means the key reaches the control.


DesktopChart.KeyUp

KeyUp(Key As String)

Fires when the passed Key is released in the control that has the focus.

It is not guaranteed to be the same key that received the KeyDown event.


DesktopChart.MenuBarSelected

MenuBarSelected

Indicates that the control has the focus and a menu (not a menu item) has been selected by the user.


DesktopChart.Opening

Opening

The control has been created and the page is opening but has not been sent to the browser yet.

The Opening event handler can be used to initialize non-visual properties and settings for controls.


DesktopChart.Pressed

Pressed(dataset As ChartDataset, index As Integer)

The user pressed on a part of the chart that represents data from the dataset.

Compatibility

Desktop projects on all supported operating systems.