wpf - Canvas control is not available in Windows form application?


Question: 

WPF Canvas control is not available in Windows form application. Am using Visual Studio 2010. Framework 4.0. Is there way to add these controls to VS2010 toolbox?




1 Answer: 

You can create a WPF Usercontrol containing the Canvas control and then host it in an ElementHost control in winforms. Details of how to do it here.

You can then add that final control to the toolbox. More details on how to do can be found on this answer.

 

More Articles


xamarin.android - How to align UI controls on a Custom Toolbar in Android xml

I'm creating a layout in Xamarin.Android and I'm working on a custom Toolbar with an image button a TextView and another label. What I need to do is Make sure the imagebutton BackButton is left aligned all the way to the left of the parent Contain, the TextView is Center Aligned and the MenuButton

java - Android Adding Buttons to Toolbar Programmatically

I am trying to create a toolbar programmatically and Add Left and Right Bar Button to it without using XML.But the button is not getting aligned to right.So kindly help me.Toolbar TopTulBarVar = new Toolbar(this);TopTulBarVar.setId(View.generateViewId());TopTulBarVar.setBackgroundColor(Color.parseCo

mfc - How do I handle toolbar messages in a dialog box

I am writing a MFC MDI application, which I started with the wizard, with visual studio 2017. In this application I have dialog boxes with toolbars. But when the dialog boxes are shown, the toolbar buttons are not enabled, even though the dialog classes contain handlers for the button IDs.For instan


visual studio - C# Registerhotkey() won't read some keycodes

While trying to create an auto clicker application using a Visual Studio Windows Form that allows you to select the hotkey you want, I stumbled upon a problemWhen a user inputs keys such as ~ or / the hotkey won't work, However, if I put in 0xC0 (for tilde) or 0xDC (for slash) instead of (int)[tilde

mfc - How to make a floating CMFCToolbar nonmovable

First I make my CMFCToolbar permanent withm_wndMyToolBar.SetPermament(TRUE); // it removes the CLOSE Button Now, how can I achieve that the user can not move the permanent CMFCToolbar?I have tried to subclass the CMFCToolbar, but the ON_WM_MOUSEMOVE & ON_WM_NCMOUSEMOVE are never called inside t

android - How to get a progress bar under the ActionBar in Material Design?

The Material Design specifications for Progress and activity specifically show in several areas a horizontal progress indicator of only a few pixels (dips) thick below whatever it is we are calling the ActionBar these days (probably Toolbar).However, I don't see any way to actually implement that po


c# - WindowsForm app with wpf windows is not working on other computers

I'm new to WPF and c# programming,i have built a winform app with a database and some wpf forms.wpf forms contain some background images and componentone tab controls.To add wpf forms:i added a wpf user control and modified its code as a window.in that case i m unable to put background images from u

configuration - PhpStorm configure to work remotely

Hi is there a way for PhpStorm to work directly on a remote server? No local files. Because as of the moment PhpStorm has local files wherein it just automatically uploads all files during save on remote.My problem is if someone changes something remotely I need to manually download it first before

wpf - Adding NAudio controls to toolbox

I am trying to use the controls from NAudio library such as WaveViewer, VolumeMeter, VolumeSlider, Fader, WaveformPainter etc. I am using Visual Studio 2012 and have net 4.5 installed. I have also downloaded and referenced NAudio 1.7 and its .dll to my project. When I right click on toolbox and clic

How to disable "Project Files Changes" alert in phpstorm?

How to disable this alert box in phpstorm.