Changing Position of an Element Programmatically in WPF

前端 未结 6 1286
时光说笑
时光说笑 2020-12-16 11:40

I did not knew that this simple thing would be slightly complicated. I have a Canvas in which I am trying to add Ellipse dynamically. Here is the code:

<         


        
6条回答
  •  攒了一身酷
    2020-12-16 11:52

    Try to convert integer type to Double type using "CDbl" function

    Try this:

    ellipse.SetValue(Canvas.LeftProperty,Cdbl(100));
    

提交回复
热议问题