[Gambas-user] Problems with HSplit
Charlie Reinl
Karl.Reinl at ...2345...
Fri Jun 26 22:02:42 CEST 2015
Am Freitag, den 26.06.2015, 13:24 -0600 schrieb herberth guzman:
> Salut Benoit
>
> as always for help.
>
> I have a Hsplit on a form
> I create 2 buttons
> run the form, the buttons look the same size
> the problem is
> when clean Hsplit (HSplit1.Children.Clean)
> and I return to create the buttons inside HSplit
> resize buttons.
>
> CODE
>
> Public Sub Form_Open ()
>
> Button1_Click '("good")
>
> End
>
> Public Sub Button1_Click () '("Here i have the problem")
>
> Dim i As Integer
>
> HSplit1.Children.Clear
> 'For Each hToggle In HSplit1.Children
> 'hToggle.Delete
> 'Next
>
> For i = 1 To 2
> hToggle = New Button (HSplit1)
> hToggle.AutoResize = True
> hToggle.Text = "T" & i
> Picture hToggle.Picture = ["icon:/32/add"]
> Next
>
> End
>
> Question...?
>
> 1- How I can cleaning and create buttons with the same dimensions.?
> 2-Where I have the error.
>
> regards and thanks for the help
>
> attached example adn image of what I explain
>
> Herberth
Salut Herberth,
Public Sub Button1_Click()
Dim i As Integer
HSplit1.Children.Clear
'For Each hToggle In HSplit1.Children
' hToggle.Delete
'Next
For i = 1 To 2
hToggle = New Button(HSplit1)
hToggle.Text = "T" & i
hToggle.Picture = Picture["icon:/32/add"]
Next
hToggle.AutoResize = True
End
this works for me.
But how you want to distinguish your buttons.
--
Amicalement
Charlie
More information about the User
mailing list