User Tools

Site Tools


control

Table of Contents

Control (QWidget)

www.kbasic.com_propertywindow.jpg

The Qt documentation in C++ of this class can be read here: http://doc.trolltech.com/4.4/qwidget.html

This is the parent class of all controls providing common functionality for all controls.

It receives mouse, keyboard and other events from the window system, and paints a representation of itself on the screen.

A Form itself is a control, which is a window with controls.

This class contains functionality for both controls and forms. Some of it makes only sense when working with forms, others when working with non-form controls.

Back to the Framework overview.

Most important

OVERVIEW

TRANSPARENT CONTROLS

See the style2 example project for more information.

For Forms set Opacity, but this will only work for top-level window forms.

For all non-form controls try to set Background to ” ”, which will neither load an image nor a color as background for the control.

Some exceptions are

  • ComboBox, provide an image as Background for the size of the ComboBox

DYNAMIC CREATION

If you would like to add controls at runtime in code, it is possible to do so.

See the add_control_on_the_fly example project for more information.

Either you create a control related to a particular form

Dim TextBox1 As TextBox
TextBox1 = New TextBox(Me)

or without relation to a form.

Dim TextBox1 As TextBox
TextBox1 = New TextBox()

METHODS

Close

Function Close() As Boolean

Closes this control. Returns true if the control was closed; otherwise returns false.

First it sends the control a OnClose. The control is hidden if it does not cancel the close event. If it cancel the event, nothing happens.

Close events are delivered to the control no matter if the control is visible or not.

If this control is a form configured as dialog, use Hide instead. Close won't work in this case.

Only useable if control is a form control.


Hide

Sub Hide()

Hides the control. This function is equivalent to Visible = False. Results in OnHide.

See also Show


Lower

Sub Lower()

Lowers the control to the bottom of the parent control's visible stack.

After this call the control will be visually behind any overlapping control.

Normally, you do not need this sub.

See also Raise


Raise

Sub Raise()

Raises this control to the top of the parent control's visible stack.

After this call the control will be visually in front of any overlapping control.

Normally, you do not need this sub.

See also Lower


Repaint

Sub Repaint()

This function does not cause an immediate repaint; instead it schedules a paint event for processing when KBasic returns to the main event loop. This permits KBasic to optimize for more speed and less flicker.

Calling it several times normally results in just one OnPaint call.


Show

Sub Show()

Shows the control and its child controls. This function is equivalent to Visible = True. Results in OnShow.

See also Hide


ShowFullScreen

Sub ShowFullScreen()

Shows the form in full-screen mode.

To return from full-screen mode, call ShowNormal.

Be aware that a form which is in the list of Forms becomes deleted from this list. After ShowNormal has been called it is part of Forms again.

Only useable if control is a form control.


ShowMaximized

Sub ShowMaximized()

Shows the form maximized.

Only useable if control is a form control.


ShowMinimized

Sub ShowMinimized()

Shows the form minimized.

Only useable if control is a form control.


ShowNormal

Sub ShowNormal()

Restores size of the form after it has been maximized or minimized.

Only useable if control is a form control.


ShowCentered

Sub ShowCentered ()

Only useable if control is a form control.

Implemented since KBasic V1.75.


IsShownFullScreen

Function IsShownFullScreen() As Boolean

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


IsShownMaximized

Function IsShownMaximized() As Boolean

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


IsShownMinimized

Function IsShownMinimized() As Boolean

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


IsShownNormal

Function IsShownNormal() As Boolean

Implemented since KBasic V1.6 (n).

Only useable if control is a form control or video control.


SetFocus

Sub SetFocus()

Gives the keyboard input focus to this control (or its FocusProxy) if this control or one of its parents is the active form.

First, a OnLostFocus event is sent to the focus control to tell it that it is about to lose the focus. Then a OnGotFocus event is sent to the other control to tell it that it just received the focus.

OnSetFocus gives focus to a control regardless of its FocusPolicy.

Be aware that if the control is hidden, it will not accept focus.

If the control is a form, it sets the form to be the active window.

An active window is a visible top-level window that has the keyboard input focus.

The Qt documentation says that

“This function performs the same operation as clicking the mouse on the title bar of a top-level window. On X11, the result depends on the Window Manager. If you want to ensure that the window is stacked on top as well you should also call Raise. Note that the window must be visible, otherwise FormSetActive() has no effect. On Windows, if you are calling this when the application is not currently the active one then it will not make it the active window. It will change the color of the taskbar entry to indicate that the window has changed in some way.”


Open

Sub Open()

Opens this control. Only useable together with forms.

First it sends the control an OnOpen. The control is shown.

Only useable if control is a form control.


Open

Sub Open(X As Integer, Y As Integer)

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


Open

Sub Open(X As Integer, Y As Integer, Width As Integer, Height As Integer)

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


OpenHidden

Sub OpenHidden ()

Opens this control. Only useable together with forms.

First it sends the control an OnOpen. The control is NOT shown.

Only useable if control is a form control.


OpenFullScreen

Sub OpenFullScreen ()

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


OpenCentered

Sub OpenCentered()

Implemented since KBasic V1.6 (n).

Only useable if control is a form control.


OpenMaximized

Sub OpenMaximized()

Implemented since KBasic V1.75.

Only useable if control is a form control.


OpenMinimized

Sub OpenMinimized()

Implemented since KBasic V1.75.

Only useable if control is a form control.


IsOpen

Function IsOpen() As Boolean

Implemented since KBasic V1.75.

Only useable if control is a form control or video control.


Move

Sub Move(X As Integer, Y As Integer)

Moves this control.

Sends the control an OnMove.


Resize

Sub Resize(Width As Integer, Height As Integer)

Resizes this control.

Sends the control an OnResize.


ToggleVisible

Sub ToggleVisible()

Implemented since KBasic V1.75.


ClearFocus

Sub ClearFocus()

Implemented since KBasic V1.75.


DataIds

Function DataIds() As Strings

Implemented since KBasic V1.75.


DataSetBoolean

Sub SetBoolean(Id As String, Boolean)

Implemented since KBasic V1.75.


DataSetInteger

Sub DataSetInteger(Id As String, Integer)

Implemented since KBasic V1.75.


DataSetLong

Sub DataSetLong(Id As String, Long)

Implemented since KBasic V1.79.


DataSetString

Sub DataSetString(Id As String, String)

Implemented since KBasic V1.75.


DataSetDouble

Sub SetDataDouble(Id As String, Double)

Implemented since KBasic V1.75.


DataSetDecimal

Sub SetDataDecimal(Id As String, Decimal)

Implemented since KBasic V1.79.


DataSetDateTime

Sub SetDataDateTime(Id As String, DateTime)

Implemented since KBasic V1.79.


DataBoolean

Function DataBoolean(Id As String) As Boolean

Implemented since KBasic V1.75.


DataInteger

Function DataInteger(Id As String) As Integer

Implemented since KBasic V1.75.


DataLong

Function DataLong(Id As String) As Long

Implemented since KBasic V1.79.


DataString

Function DataString(Id As String) As String

Implemented since KBasic V1.75.


DataDouble

Function DataDouble(Id As String) As Double

Implemented since KBasic V1.75.


DataDecimal

Function DataDecimal(Id As String) As Decimal

Implemented since KBasic V1.79.


DataDateTime

Function DataDateTime(Id As String) As DateTime

Implemented since KBasic V1.79.


SingleShot

Sub SingleShot(Milliseconds As Integer)

Sends the control an OnSingleShot after Milliseconds ellapsed.

Implemented since KBasic V1.75.


StartTimer

Sub StartTimer()

Sends the control an OnTimer after Milliseconds determined by TimerInterval ellapsed.

Implemented since KBasic V1.75.


StopTimer

Sub StopTimer()

Implemented since KBasic V1.75.


GlobalX

Function GlobalX(Integer) As Integer

Implemented since KBasic V1.75.


GlobalY

Function GlobalY(Integer) As Integer

Implemented since KBasic V1.75.


LocalX

Function LocalX(Integer) As Integer

Implemented since KBasic V1.75.


LocalY

Function LocalY(Integer) As Integer

Implemented since KBasic V1.75.


UnderMouse

Function UnderMouse() As Boolean

Implemented since KBasic V1.75.


PROPERTIES

Name

Property Name As String (ReadWrite)

The name of the control.

Be sure to name it unique. Otherwise your form will be messed up.


Layout

Property Layout As String (ReadOnly)

It is useful to give a control features like automatic stretching (Width and Height) and automatic moving (X and Y) relative to its parent.


Group

Property Group As String (ReadWrite)

Contains the group to which the control belongs. Normally, you need only to set it, if you need RadioButtons to be in exclusive mode (only one at a time may be selected). Or, if you need to handle the same event at one place for many controls.


Background

Property Background As String (ReadWrite)

Background might be a color or an image. If you set a color use this format &HRRGGBB (RGB value) e.g. &H00FF00 (green). An image can be an absolute path to an image file (png, jpg,…) like c:\myfolder\myimage.png or can be an relative path to the current project like myimage.png (which is present in the current project directory). Relative paths are recommended.

Color objects of the class Colors must not be used yet.

Example

Dim c As CommandButton
c = Control("Button0") ' Button0 is declared in current form
c.Background = "tux.jpg" ' relative path. File exists in current project directory
c.Background = "&H00FF00" ' set the background to green
c.Background = "Red" ' set the background to red

Predefined color values

“White”, “Black”, “Red”, “DarkRed”, “Green”, “DarkGreen”, “Blue”, “DarkBlue”, “Cyan”, “DarkCyan”, “Magenta”, “DarkMagenta”, “Yellow”, “DarkYellow”, “Gray”, “DarkGray”, “LightGray”.

Color objects of the class Colors must not be used yet.


BackgroundStyle

Property BackgroundStyle As String (ReadWrite)

Implemented since KBasic V1.74.

Possible values are

  • Gradient

Only available for the following controls

  • Label
  • CheckBox
  • RadioButton
  • CommandButton

Adds a gradient background like used in Windows Vista for some controls.

Please do not forget to set the Background to some color.


Palette

Property Palette As String (ReadWrite)

Implemented since KBasic V1.74.

Active (or Normal), Inactive or Disabled may be used as prefix.

WindowA general background color.
WindowTextA general foreground color.
BaseUsed mostly as the background color for text entry widgets, but can also be used for other painting - such as the background of combobox drop down lists and toolbar handles. It is usually white or another light color.
AlternateBaseUsed as the alternate background color in views with alternating row colors
ToolTipBaseUsed as the background color for ToolTip and WhatsThis.
ToolTipTextUsed as the foreground color for ToolTip and WhatsThis.
TextThe foreground color used with Base. This is usually the same as the WindowText, in which case it must provide good contrast with Window and Base.
ButtonThe general button background color. This background can be different from Window as some styles require a different background color for buttons.
ButtonTextA foreground color used with the Button color.
BrightTextA text color that is very different from WindowText, and contrasts well with e.g. Dark. Typically used for text that needs to be drawn where Text or WindowText would give poor contrast, such as on pressed push buttons. Note that text colors can be used for things other than just words; text colors are usually used for text, but it's quite common to use the text color roles for lines, icons, etc.
Light Lighter than Button color.
Midlight Between Button and Light.
Dark Darker than Button.
MidBetween Button and Dark.
Shadow A very dark color. By default, the shadow color is black.
HighlightA color to indicate a selected item or the current item. By default, the highlight color is dark blue.
HighlightedText A text color that contrasts with Highlight. By default, the highlighted text color is white.
LinkA text color used for unvisited hyperlinks. By default, the link color is blue.
LinkVisited A text color used for already visited hyperlinks. By default, the linkvisited color is magenta.

Examples

WindowText=&HFF0000;Window=&HFF0000;

Normal:Window=&HFF0000;Active:WindowText=&HFF0000;Inactive:WindowText=&H00F000;Disabled:WindowText=&H00F000;

X

Property X As Integer (ReadWrite)

Left position on the screen of the control.


Y

Property Y As Integer (ReadWrite)

Top position on the screen of the control.


Width

Property Width As Integer (ReadWrite)


Height

Property Height As Integer (ReadWrite)


Left

Property Left As Integer (ReadWrite)

Left position on the screen of the control. Provided for your convinience.

Implemented since KBasic V1.75.


Top

Property Top As Integer (ReadWrite)

Top position on the screen of the control. Provided for your convinience.

Implemented since KBasic V1.75.


GlobalX

Property GlobalX As Integer

Contains the x position relative to the entire screen and the parent control or parent form.


GlobalY

Property GlobalY As Integer

Contains the y position relative to the entire screen and the parent control or parent form.


LocalX

Property LocalX As Integer

Same as X. Provided for your convinience.


LocalY

Property LocalY As Integer

Same as Y. Provided for your convinience.


OldX

Property OldX As Integer (ReadOnly)

Contains the old x value of that control before the current x was set.


OldY

Property OldY As Integer (ReadOnly)

Contains the old y value of that control before the current y was set.


OldWidth

Property OldWidth As Integer (ReadOnly)

Contains the old width value of that control before the current width was set.


OldHeight

Property OldHeight As Integer (ReadOnly)

Contains the old height value of that control before the current height was set.


LoadedX

ReadOnly LoadedX As Integer (ReadOnly)


LoadedY

ReadOnly LoadedY As Integer (ReadOnly)


LoadedWidth

ReadOnly LoadedWidth As Integer (ReadOnly)


LoadedHeight

ReadOnly LoadedHeight As Integer (ReadOnly)


MinimumWidth

ReadWrite MinimumWidth As Integer

Useful for extended layout management.


MinimumHeight

ReadWrite MinimumHeight As Integer

Useful for extended layout management.


MaximumWidth

ReadWrite MaximumWidth As Integer

Useful for extended layout management.


MaximumHeight

ReadWrite MaximumHeight As Integer

Useful for extended layout management.


Tag

ReadWrite Tag As String

This is freely to use for custom property values.


CSV

ReadWrite CSV As String

Used by some controls like ComboBox to store comma separated values (CSV).

It is possible to define images for each entry. Encloses every image file name into [ [ ] ]. Here is an example

[[irc_op.png]]ComboBoxBox;[[icq_protocol]]1st Entry;2nd Entry;3rd Entry

SQL

ReadWrite SQL As String

This is not the binding sql name for the control. If you would like to bind your control to a table see SQLName

Contains a sql select statement for custom sql data filling.

Used by some controls like ComboBox to store values generated by a sql query.

This makes only sense when used together with ComboBox, TextBox, ListView, TreeView or ListBox. Other controls are not supported.

For TextBox, the sql fills the completer property and for TreeView, it provides the data to be displayed.

It is important that when you select two columns the first one is treated as data and the other column(s) are treated as caption. The data can be used in code for further event handling.

SELECT id, name, code FROM myTable

ParentForm

ReadOnly ParentForm As String

This is used by child controls (e.g. contained form in a form) to get information about the parent form.


ParentControl

ReadOnly ParentControl As String

Returns the parent control. Normally, it is a tab control.

For forms it is always an empty string ””, neither this form is contained in a child control or not.


ControlType

ReadOnly ControlType As String

Possible values are e.g.

  • CommandButton
  • TextBox
  • Editor
  • Browser
  • CheckBox
  • RadioButton
  • Label
  • Tab
  • Box

and much more!


Focus

ReadOnly Focus As Boolean

If the control has got the focus now.


FocusPolicy

ReadWrite FocusPolicy As String

Possible values are TabFocus, ClickFocus, StrongFocus, WheelFocus, NoFocus


FocusProxy

ReadOnly FocusProxy As String

See the project example “focus” shipping with KBasic.


FocusOrder

ReadOnly FocusOrder As Integer

Start with number 1 for the first control.

If FocusOrder is set to 0 (default), it will not be in the focus chain, managing tabbing through controls. It will gain focus by accident.

To change the order in which a control receives focus you need to set this property to different value for each control. Lower values receive the focus first and proceed numerically through higher values.


Cursor

ReadWrite Cursor As String

Set the cursor for that control. If the mouse pointer is over the control, it will change to one of the following shapes.

Might be a String containing binary data. See the binary project example for using.

Possible values are:

  • ArrowCursor
  • UpArrowCursor
  • CrossCursor
  • WaitCursor
  • IBeamCursor
  • SizeVerCursor
  • SizeHorCursor
  • SizeFDiagCursor
  • SizeBDiagCursor
  • SizeAllCursor
  • BlankCursor
  • SplitVCursor
  • SplitHCursor
  • PointingHandCursor
  • ForbiddenCursor
  • OpenHandCursor
  • ClosedHandCursor
  • WhatsThisCursor
  • BusyCursor

Cursor might be an image. An image can be an absolute path to an image file (png, jpg,…) like c:\myfolder\myimage.png or can be an relative path to the current project like myimage.png (which is present in the current project directory). Relative paths are recommended.

Example

Cursor = "tux.jpg" ' relative path. File exists in current project directory

CursorAnimation

Implemented since KBasic V1.75.

ReadWrite CursorAnimation As String


FontName

ReadWrite FontName As String

e.g. “Arial”, “Courier”


FontSize

ReadWrite FontSize As Integer


FontItalic

ReadWrite FontItalic As Boolean


FontBold

ReadWrite FontBold As Boolean


FontUnderline

ReadWrite FontUnderline As Boolean


FontColor

ReadWrite FontColor As String

If you set a color use this format &HRRGGBB (RGB value) e.g. &H00FF00 (green).

Color objects of the class Colors must not be used yet.

Example

Dim c As CommandButton
c = Control("Button0") ' Button0 is declared in current form
c.FontColor = "&H00FF00" ' set the background to green

Predefined color values

“White”, “Black”, “Red”, “DarkRed”, “Green”, “DarkGreen”, “Blue”, “DarkBlue”, “Cyan”, “DarkCyan”, “Magenta”, “DarkMagenta”, “Yellow”, “DarkYellow”, “Gray”, “DarkGray”, “LightGray”.

Color objects of the class Colors must not be used yet.


Enabled

ReadWrite Enabled As Boolean

Results in OnEnabled or OnDisabled.


Visible

ReadWrite Visible As Boolean

Results in OnShow or OnHide.


StatusTip

ReadWrite StatusTip As String

Text is shown in the statusbar, if it is selected or so. Behaviour depends on the control type.


ToolTip

ReadWrite ToolTip As String

Behaviour depends on the control type.


SytleSheet

ReadWrite SytleSheet As String

Example for TextBox (QLineEdit) setting the background yellow:

 QLineEdit { background: yellow }

Fore more information read http://doc.trolltech.com/4.3/stylesheet.html


WhatsThis

ReadWrite WhatsThis As String

Not implemented yet.


TimerInterval

ReadOnly TimerInterval As Integer

Calls OnTimer after TimerInterval milli seconds.

TimerInterval = 1000 means 1 second

For a form: OnTimer is only called after the form was opened and StartTimer has been called.


Opacity

ReadWrite Opacity As Integer

This only works on Mac OS X and Windows 2000 or later. It might work on Linux as well.

Makes only sense for form controls. Set the transparent level for the form control. Only forms with no parent are affected, but forms (normal forms only) inside a mainwindow and Dialogs emulate this feature by setting a own background palette with alpha value. In this case, a background value must not be set by you.

Values from 0 to 100 are allowed.

  • 0 means completely transparent.
  • 100 means completely visible.

ContextMenu

ReadWrite ContextMenu As String

The name of the menubaritem holding the context menu to be displayed when the context menu for this control is requested.


DrawOnPaint

ReadWrite DrawOnPaint As Boolean

If it is set to false, the controls won’t draw the default look. This is useful, if you want to provide custom drawing without the default look.

Implemented since KBasic V1.75.


Mask

ReadWrite Mask As String

Causes only the pixels of the control for which mask has a corresponding value to be visible. Note that this effect can be slow if it is particularly complex. Masked controls receive mouse events only on their visible portions.

Implemented since KBasic V1.75.


SoundOnEvent

ReadWrite SoundOnEvent As String

Implemented since KBasic V1.75.


ShowMode

ReadOnly ShowMode As String

Only useful for form controls now.

Implemented since KBasic V1.75.


MouseTracking

ReadWrite MouseTracking As Boolean

Implemented since KBasic V1.75.


HIDDEN PROPERTIES

TabIndex

ReadOnly TabIndex As Integer

Internally used by KBasic to set up tabs.


ParentIndex

ReadOnly ParentIndex As Integer

Internally used by KBasic.


EVENTS

CloseOnClose , OpenOnOpen , OpenHiddenOnOpen,

HideOnHide , Visible = False → OnHide , ShowOnShow , Visible = True → OnShow,

MoveOnMove, ResizeOnResize,

RepaintAlwaysOnPaint, RepaintOnPaint,

XOnMove, YOnMove, WidthOnResize, HeightOnResize,

SetFocusOnLostFocus/OnGotFocus

Mouse cursor comes over control → OnEnter, Mouse cursor was over control, but is now outside of it → OnExit,

Key down first time→ OnKeyDown, Key was down, but now released → OnKeyUp, Key was first time pressed and now continued pressed → OnKeyPress,

Mouse double clicked on control → OnDblClick, Mouse double or only one time clicked on control → OnClick,

Mouse cursor moves over control → OnMouseMove, Mouse button down first time → OnMouseDown, Mouse button was down, but now released → OnMouseUp,

Every milli seconds of TimerIntervalOnTimer,


OnOpen

OnOpen()

Only used by form controls.


OnClose

OnClose(ByRef Cancel As Boolean)

Only used by form controls. If you reimplement this sub and set Cancel = True, the form won't close.


OnEnter

OnEnter()

Raised whenever mouse cursor enters the boundary of a control.


OnGotFocus

OnGotFocus()

Form objects do not receive this event.

FocusPolicy must be set correctly, if this should work for a form as well.


OnLostFocus

OnLostFocus()

Form objects do not receive this event.


OnHide

OnHide()


OnKeyDown

OnKeyDown(KeyCode As Integer, Shift As Boolean, Control As Boolean, Alt As Boolean)

See Key Codes for possible key code values.

Note that this function does not distinguish between capital and non-capital letters.


OnKeyUp

OnKeyUp(KeyCode As Integer, Shift As Boolean, Control As Boolean, Alt As Boolean)

See Key Codes for possible key code values.

Note that this function does not distinguish between capital and non-capital letters.


OnKeyPress

OnKeyPress(KeyCode As Integer, Shift As Boolean, Control As Boolean, Alt As Boolean)

See Key Codes for possible key code values.

Note that this function does not distinguish between capital and non-capital letters.


OnExit

OnExit()

Raised whenever mouse cursor leaves the boundary of a control.


OnDblClick

OnDblClick(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean)

Note that the controls get a OnMouseDown(…) and an OnMouseUp(…) before the OnDblClick(…).


OnClick

OnClick(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean)


OnMouseMove

OnMouseMove(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean)

Because of performance reasons, this event only works with Box and Form controls yet.


OnMouseDown

OnMouseDown(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean)


OnMouseUp

OnMouseDown(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean)


OnMove

OnMove(X As Integer, Y As Integer, OldX As Integer, OldY As Integer)


OnPaint

OnPaint(X As Integer, Y As Integer, Width As Integer, Height As Integer)

Currently, you may only use OnPaint with Box or Form objects.

Use the static Paint object to do your custom drawing.


OnResize

OnResize(Width As Integer, Height As Integer, OldWidth As Integer, OldHeight As Integer)


OnShow

OnShow()


OnTimer

OnTimer()

Only useable if control is a form control.


OnMouseWheel

OnMouseWheel(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer)


OnMultiPageShow

OnMultiPageShow(Page As Integer)

Only useable if control is a form control.


OnContextMenu

OnContextMenu(X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer)


OnSingleShot

OnSingleShot()

Implemented since KBasic V1.75.


OnEnabled

OnEnabled ()

Implemented since KBasic V1.75.


OnDisabled

OnDisabled ()

Implemented since KBasic V1.75.


OnDragEnter

OnDragEnter(ByRef Cancel As Boolean, X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, Width As Integer, Height As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean, Shift As Boolean, Control As Boolean, Alt As Boolean)

Implemented since KBasic V1.75.


OnDragMove

OnDragMove(ByRef Cancel As Boolean, X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, Width As Integer, Height As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean, Shift As Boolean, Control As Boolean, Alt As Boolean)

Implemented since KBasic V1.75.


OnDragExit

OnDragExit()

Implemented since KBasic V1.75.


OnDrop

OnDragMove(ByRef Cancel As Boolean, MimeData As String, X As Integer, Y As Integer, GlobalX As Integer, GlobalY As Integer, LeftButton As Boolean, RightButton As Boolean, MidButton As Boolean, Shift As Boolean, Control As Boolean, Alt As Boolean)

Implemented since KBasic V1.75.


SQL PROPERTIES

SQLName

ReadOnly SQLName As String

Some controls may use this property only: Label, ListBox, ComboBox, TextBox, DateBox, TimeBox


SQLRelation

ReadOnly SQLRelation As String

This makes only sense when used together with ComboBox or ListBox. Other controls are not supported except for child controls.


TableViewCaption

ReadOnly TableViewCaption As String


TableViewWidth

ReadOnly TableViewWidth As Integer


TableViewVisible

ReadOnly TableViewVisible As Boolean


Key Codes

On Mac OS X, Key.Control corresponds to the Command keys and Key.Meta corresponds to the Control keys.

Predefined key codes are:

Key.Escape , Key.Tab , Key.Backtab , Key.Backspace , Key.Return , Key.Enter , Key.Insert , Key.Delete , Key.Pause , Key.Print , Key.SysReq , Key.Clear , Key.Home , Key.End , Key.Left , Key.Up , Key.Right , Key.Down , Key.PageUp , Key.PageDown , Key.Shift , Key.Control , Key.Meta , Key.Alt , Key.AltGr , Key.CapsLock , Key.NumLock , Key.ScrollLock , Key.F1 , Key.F2 , Key.F3 , Key.F4 , Key.F5 , Key.F6 , Key.F7 , Key.F8 , Key.F9 , Key.F10 , Key.F11 , Key.F12 , Key.F13 , Key.F14 , Key.F15 , Key.F16 , Key.F17 , Key.F18 , Key.F19 , Key.F20 , Key.F21 , Key.F22 , Key.F23 , Key.F24 , Key.F25 , Key.F26 , Key.F27 , Key.F28 , Key.F29 , Key.F30 , Key.F31 , Key.F32 , Key.F33 , Key.F34 , Key.F35 , Key.Super_L , Key.Super_R , Key.Menu , Key.Hyper_L , Key.Hyper_R , Key.Help , Key.Direction_L , Key.Direction_RKey.Space , Key.Any , Key.Exclam , Key.QuoteDbl , Key.NumberSign , Key.Dollar , Key.Percent , Key.Ampersand , Key.Apostrophe , Key.ParenLeft , Key.ParenRight , Key.Asterisk , KeyPlus , Key.Comma , Key.Minus , Key.Period , Key.Slash , Key.0 , Key.1 , Key.2 , Key.3 , Key.4 , Key.5 , Key.6 , Key.7 , Key.8 , Key.9 , Key.Colon , Key.Semicolon , Key.Less , Key.Equal , Key.Greater , Key.Question , Key.At , Key.A , Key.B , Key.C , Key. , Key.E , Key.F , Key.G , Key.H , Key.I , Key.J , Key.K , Key.L , Key.M , Key.N , Key.O , Key.P , Key.Q , Key.R , Key.S , Key.T , Key.U , Key.V , Key.W , Key.X , Key.Y , Key.Z , Key.BracketLeft , Key.Backslash , Key.BracketRight , Key.AsciiCircum , Key.Underscore , Key.QuoteLeft , Key.BraceLeft , Key.Bar , Key.BraceRight , Key.AsciiTilde , Key.nobreakspace , Key.exclamdown , Key.cent , Key.sterling , Key.currency , Key.yen , Key.brokenbar , Key.section , Key.diaeresis , Key.copyright , Key.ordfeminine , Key.guillemotleft , Key.notsign , Key.hyphen , Key.registered , Key.macron , Key.degree , Key.plusminus , Key.twosuperior , Key.threesuperior , Key.acute , Key.mu , Key.paragraph , Key.periodcentered , Key.cedilla , Key.onesuperior , Key.masculine , Key.guillemotright , Key.onequarter , Key.onehalf , Key.threequarters , Key.questiondown , Key.Agrave , Key.Aacute , Key.Acircumflex , Key.Atilde , Key.Adiaeresis , Key.Aring , Key.AE , Key.Ccedilla , Key.Egrave , Key.Eacute , Key.Ecircumflex , Key.Ediaeresis , Key.Igrave , Key.Iacute , Key.Icircumflex , Key.Idiaeresis , Key.ETH , Key.Ntilde , Key.Ograve , Key.Oacute , Key.Ocircumflex , Key.Otilde , Key.Odiaeresis , Key.multiply , Key.Oobique , Key.Ugrave , Key.Uacute , Key.Ucircumflex , Key.Udiaeresis , Key.Yacute , Key.THORN , Key.ssharp , Key.division , Key.ydiaeresis , Key.Multi_key , Key.Codeinput , Key.SingleCandidate , Key.MultipleCandidate , Key.PreviousCandidate , Key.Mode_switch , Key.Kanji , Key.Muhenkan , Key.Henkan , Key.Romaji , Key.Hiragana , Key.Katakana , Key.Hiragana_Katakana , Key.Zenkaku , Key.Hankaku , Key.Zenkaku_Hankaku , Key.Touroku , Key.Massyo , Key.Kana_Lock , Key.Kana_Shift , Key.Eisu_Shift , Key.Eisu_toggle , Key.Hangul , Key.Hangul_Start , Key.Hangul_End , Key.Hangul_Hanja , Key.Hangul_Jamo , Key.Hangul_Romaja , Key.Hangul_Jeonja , Key.Hangul_Banja , Key.Hangul_PreHanja , Key.Hangul_PostHanja , Key.Hangul_Special , Key.Dead_Grave , Key.Dead_Acute , Key.Dead_Circumflex , Key.Dead_Tilde , Key.Dead_Macron , Key.Dead_Breve , Key.Dead_Abovedot , Key.Dead_Diaeresis , Key.Dead_Abovering , Key.Dead_Doubleacute , Key.Dead_Caron , Key.Dead_Cedilla , Key.Dead_Ogonek , Key.Dead_Iota , Key.Dead_Voiced_Sound , Key.Dead_Semivoiced_Sound , Key.Dead_Belowdot , , Key.Dead_Hook , Key.Dead_Horn , Key.Back , Key.Forward , Key.Stop , Key.Refresh , Key.VolumeDown , Key.VolumeMute , Key.VolumeUp , Key.BassBoost , Key.BassUp , Key.BassDown , Key.TrebleUp , Key.TrebleDown , Key.MediaPlay , Key.MediaStopKey.MediaPrevious , Key.MediaNext , Key.MediaRecord , Key.HomePage , Key.Favorites , Key.Search , Key.Standby , Key.OpenUrl , Key.LaunchMail , Key.LaunchMedia , Key.Launch0 , Key.Launch1 , Key.Launch2 , Key.Launch3 , Key.Launch4 , Key.Launch5 , Key.Launch6 , Key.Launch7 , Key.Launch8 , Key.Launch9 , Key.LaunchA , Key.LaunchB , Key.LaunchC , Key.LaunchD , Key.LaunchE , Key.LaunchF , Key.MediaLast , Key.unknown , Key.Call , Key.Context1 , Key.Context2 , Key.Context3 , Key.Context4 , Key.Flip , Key.Hangup , Key.No , Key.Select , Key.Yes , Key.Execute , Key.Printer , Key.Play , Key.Sleep , Key.Zoom , Key.Cancel ,

COMMENTS

Open a form

Dim f As bernd ' assume that bernd is a form class created with the form designer
f = New bernd
f.Open()

' OR

Forms.Open("bernd") ' for this call you must setup mainwindow in projects properties

Written by Bernd Noetscher

Date 2007-02-22

control.txt · Last modified: 2013/04/09 22:57 (external edit)