Custom Component problem
Posted
#1
(In Topic #240)
Regular

The idea is to have a single component to step though an index of items, e.g. a collection of photos.
So far the project works but I'd like to fix the overall dimensions of the component, at the moment, when selected from the 'Form' controls the control is completely the wrong shape.
Code (gambas)
- ' Gambas class file
- Inherits UserControl
- Event Click
- iBtnSize = 30
- .X = iBtnLeft[1] + iBtnSize + 5
- .Y = 5
- .H = iBtnSize
- .W = 70
- .Alignment = Align.Center
- .X = iBtnLeft[i]
- .Y = 5
- .H = iBtnSize
- .W = iBtnSize
- .tag = i
- Case 0
- iIndex = 0
- Case 1
- Case 2
- Case 3
- iIndex = iItemCount - 1
- ShowItems
- Raise Click
- hLabel.Text = (iIndex + 1) & " of " & iItemCount
- iItemCount = i
- hLabel.Text = (iIndex + 1) & " of " & iItemCount
Any help would be appreciated
Posted
Expert

I got this from the gambas Wiki - Did not see any of the following code in your example so looks like the X{Position} ect is what you are missing
For example, the value of Control._Properties is:
Code (gambas)
- Background\{Color}=-1,Foreground\{Color}=-1,Tag,
- ToolTip,Drop,Expand,Ignore
Link to the 'How to ' components page is http://www.gambaswiki.org/wiki/dev/gambas
One of the projects that I have on my 'to-do' list is a checked list box - something I miss from my .net days.
I have one working in a standard class but need to go down the same route as you with a fully compiled one.
Cheers - Quin.
I code therefore I am
I code therefore I am
Posted
Regular

I added :-
Code
Public Const _DefaultSize As String = "31,6"
Still a lot to learn!
1 guest and 0 members have just viewed this.


