B4J Question pane1.width = READ ONLY

MarcRB

Active Member
Licensed User
Longtime User
Is it true it isn't possible to change the width property of a pane by code?
pane.width = 300dip (read only)

I like to grow pane width on _MouseEntered and go back to small on _MouseExited event

Something like this...:
'just a not working example :)
Private Sub PanMenu_MouseEntered (EventData As MouseEvent)
    panMenu.Width = 200  'this is read only
    panContent.Left = panMenu.Width
    panContent.Width = B4XPages.GetNativeParent(Me).Width    - panContent.Left
End Sub

Private Sub PanMenu_MouseExited (EventData As MouseEvent)
    panMenu.Width = 60  'this is read only
    panContent.Left = panMenu.Width
    panContent.Width = B4XPages.GetNativeParent(Me).Width    - panContent.Left
End Sub


Best regards,
Marc
 

Star-Dust

Expert
Licensed User
Longtime User
Use Panel.PrefWith
 
Upvote 0
Solution

MarcRB

Active Member
Licensed User
Longtime User
It seems that your project is a B4XPages project.
How did you declare the Pane as a Pane or a B4XView.
You might have used B4XView, then Width would work.
Yes it was originaly declared as pane.
Now I changed it to B4XView and i went back to width instead of prefWidth.

Thank you. (also thanks to Star-Dust.)
 
Upvote 0
Top