question

65010773 avatar image
0 Votes"
65010773 asked ·

How to use height and width of relative panel that values are Nan

Hi

 I  have a classX  with  contructor 
  Public Sub New(ByVal heightbar As Double, ByVal widthcanvas As Double, Optional ByVal bottom As Double = 0)
 The  problem i have to pass as parameter the width and height of a relative pane  which  are Nan .
    
 Is there a solution  ?
 Thanks 
windows-uwp
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

jtorjo avatar image
0 Votes"
jtorjo answered ·

Assuming you have the controls themselves, you can use ctrl.ActualWidth, and ctrl.ActualHeight


· 1 ·
10 |1000 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi
Thanks

There is a little problem because it works only if the ctrl is displayed.
Assume there is a button and at the click event i need to get the ctrl.actual width



 Private Sub button1_Click(sender As Object, e As RoutedEventArgs) Handles button1.Click
    
   myctrl.visibilty = = Visibility.Visible
 dim drawobj as classdraw
    drawobj = new classdraw(myctrl.actualheight,myctrl.actualheight)
 end sub

myctrl.actualheight = 0

0 Votes 0 ·