Using Canvas in Windows Form .net application
I want to create a Winform
application which displays Datagrid
, Charts
on it. My requirement is, that the user should be able to position those elements according to his choice, like we drop text box
, label
in winform design view. I know that there is a Canvas
class in WPF, but I want to achieve the same with Winforms
.
Can I use the WPF开发者_JS百科 Canvas
in Winform
? Or is there any other solution?
You can use a WPF Canvas in a Windows Forms application. Just place the Canvas inside of an ElementHost control.
I came across this code while searching for an answer, it comes from a Stephens' VB trainer example:
Dim canvas As New Bitmap(
picCanvas.ClientSize.Width,
picCanvas.ClientSize.Height)
精彩评论