You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/CustomControls/Defining a CustomControl.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Defining a CustomControl
3
3
parent: CustomControls
4
4
nav_order: 2
5
-
permalink: /CustomControls/Defining/
5
+
permalink: /CustomControls/Defining
6
6
---
7
7
# Defining a CustomControl
8
8
A CustomControl is simply an ordinary twinBASIC class, with a few extra attributes and requirements.
@@ -46,7 +46,7 @@ All CustomControls *must* implement CustomControls.ICustomControl. This interfa
46
46
```vb
47
47
SubInitialize(ByValContextAsCustomControlContext)
48
48
```
49
-
49
+
50
50
This method is called when your control is attached to a form. You must store the provided Context object in a class field as it offers a `Repaint()` method for informing the form engine that something in your control has changed and needs to be repainted.
51
51
52
52
```vb
@@ -59,7 +59,7 @@ This method is called when your control is detached from a form. This allows an
59
59
SubPaint(ByValCanvasAsCanvas)
60
60
```
61
61
62
-
This is the most interesting part for a CustomControl. As such, it gets its own section, see [Painting / drawing to your control](../Painting/)
62
+
This is the most interesting part for a CustomControl. As such, it gets its own section, see [Painting / drawing to your control](/CustomControls/Painting)
63
63
64
64
***
65
65
## Minimum set of properties
@@ -78,7 +78,7 @@ Public Visible As Boolean
78
78
79
79
The form designer and the form engine work with these properties, so it is important to include them in your CustomControl class.
80
80
81
-
Note that the form designer works with pixel values which are not DPI-scaled. So the Left/Top/Width/Height properties of your control do not reflect DPI scaling. For example, if your control has a width of 50 pixels, then at DPI 150%, then the actual drawing width is 75 pixels ( see [Painting / drawing to your control](CustomControls/Painting/)).
81
+
Note that the form designer works with pixel values which are not DPI-scaled. So the Left/Top/Width/Height properties of your control do not reflect DPI scaling. For example, if your control has a width of 50 pixels, then at DPI 150%, then the actual drawing width is 75 pixels ( see [Painting / drawing to your control](/CustomControls/Painting)).
82
82
83
83
***
84
84
## Must have a serialization constructor
@@ -88,4 +88,4 @@ CustomControls *must* offer a serialization constructor:
88
88
PublicSubNew(SerializerAsSerializationInfo)
89
89
```
90
90
91
-
The passed in Serializer object offers a `Deserialize()` method that you call in order to load the properties that have been set for your control via the form designer. See [Property Sheet and Object Serialization](CustomControls/Properties/) for further information.
91
+
The passed in Serializer object offers a `Deserialize()` method that you call in order to load the properties that have been set for your control via the form designer. See [Property Sheet and Object Serialization](/CustomControls/Properties) for further information.
Copy file name to clipboardExpand all lines: docs/CustomControls/Property sheet and object serialization.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Property Sheet and Object Serialization
3
3
parent: CustomControls
4
4
nav_order: 3
5
-
permalink: /CustomControls/Properties/
5
+
permalink: /CustomControls/Properties
6
6
---
7
7
# Property Sheet and Object Serialization
8
8
The form designer property sheet will pickup any **_public_** custom properties (fields) that you expose via your CustomControl class. For example, adding a field `Public MyField As Long` will then automatically show up in the control property sheet in the form designer:
Copy file name to clipboardExpand all lines: docs/Features/Overview.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
title: Overview
3
3
parent: Features
4
4
nav_order: 1
5
-
permalink: /Features/Overview/
5
+
permalink: /Features/Overview
6
6
---
7
7
8
8
# Overview
@@ -1191,7 +1191,7 @@ In addition to the above, forms have:
1191
1191
* Control anchoring: control x/y/cx/cy can made relative, so they're automatically moved/resized with the Form. For example if you put a TextBox in the bottom right, then check the Right and Bottom anchors (in addition to Top and Left), the bottom right will size with the form on resize. This saves a lot of boiler-plate sizing code.
1192
1192
* Control docking: Controls can be fixed along one of the sides of the Form (or container), or made to fill the whole Form/container. Multiple controls can be combined and mixed/matched in docking positions.
1193
1193
1194
-
For more information on Control Anchoring and Control Docking, see the Wiki entry [Control Anchoring and Docking ‐ Automatic size and position management](../Anchoring-Docking).
1194
+
For more information on Control Anchoring and Control Docking, see the Wiki entry [Control Anchoring and Docking ‐ Automatic size and position management](Anchoring-Docking).
1195
1195
1196
1196
## Unicode support
1197
1197
All tB-implemented controls support Unicode, both in the code editor and when displayed.
@@ -1213,7 +1213,7 @@ tB will eventually replace all built in controls that you're used to, for now th
1213
1213
1214
1214
### Alternatives for unimplemented controls
1215
1215
1216
-
The best option is Krool's VBCCR and VBFlexGrid projects. These are now available [from the Package Server](Packages---Importing-a-package-from-TWINSERV) in x64-compatible form, and are also DPI aware and support Visual Styles.
1216
+
The best option is Krool's VBCCR and VBFlexGrid projects. These are now available [from the Package Server](../Packages/Importing-TWINSERV/) in x64-compatible form, and are also DPI aware and support Visual Styles.
1217
1217
1218
1218
Additionally, the original OCX controls provided by Microsoft will work fine; however, they're mostly 32-bit only. The x64 version of `MSComCtl.ocx` doesn't come with Windows and isn't legally redistributable but if you have Office 64bit, it works in tB.
0 commit comments