Error when Add GMap Control to the Toolbox - wpf

I'm Trying to Add GMap Control in my WPF project. But Got Error Message ("There is no component in GMap.NET.WindowsPresentation.dll that can be placed on the toolbox").

Related

Paste text into application behind my WPF app

I'm creating a WPF application where the user can click on a symbol and the app will paste that symbol into the application behind it (for example, into a web browser's text box or a Word document).
I'm having trouble with being able to remove the focus of my WPF app, so that when I use SendKeys, the symbol will be pasted into the other application. I am using the following code so far, but I don't want the window to hide, just be unfocused.
Clipboard.SetText("{symbol}")
Hide()
Forms.SendKeys.SendWait("^v")
Show()
Can anyone help? Thanks in advance.

Popup topmost only outlook window

I have created a Outlook Addin Project and I used WPF user control as element host in UserControl(WinForm) which is loaded using Custom Task Pane.
I have some dragoperation in wpf usercontrol which will open Popup.
The problem is the popup is showing topmost window for all the windows.
I need to show/visible only when outlook window activated. Appreciate your help
You need to make sure your popup is a child of the appropriate Outlook window. You cast Outlook Inspector or Explorer object to IOleWindow interface and call IOleWindow.GetWindow to retrieve HWND. You can then use WindowInteropHelper class along with the retrieved HWND to display your window.

How to use .js and .css file in SilverLight application

I am using a customized alert message for my whole application which generates from a .js file and a .css file. I have also used silverlight in my application and shows MessageBox from silverlight with its default design. Now i want to customized that MessageBox in silverlight.
So, can anyone plz help me to know how to add js and css file to silverLight application and how to use it
You can't change the built-in MessageBox style as easily as simply creating your own modal window. There are lots of custom messageboxes about and many have source code.
e.g.
Creating a reusable MessageBox dialog.
Silverlight Modal Dialog With Custom User Controls
Custom MessageBox Control for Silverlight 3
Note: these are all Silverlight solutions, so you are authoring in XAML and with style, not using JS and CSS.
It is also possible to call JS functions on the page from within Silverlight if you think that will be easier for your solution.

"Please wait" Windows in WPF

I need to create a "please wait" window at the start up of my application, start animation and at the lifetime of app change visibility. I don`t want create explicitly new thread (Maybe ThreadPool or BackgroundWorker).
Any ideas?
WPF has a very nice splash screen class exactly for that: http://www.codeproject.com/Articles/36418/WPF-Splash-Screen.aspx
Here is the quick steps:
Add the image file to the WPF Application project. For more information, see How to: Add Existing Items to a Project.
In Solution Explorer, select the image.
Add the image file to the WPF Application project. For more information, see How to: Add Existing Items to a Project.
In the Properties window, click the drop-down arrow for the Build Action property.
Select SplashScreen from the drop-down list
(source here: WPF SplashScreen implementing)

Inserting Winforms Form inside XAML WPF

I'm trying to integrate a WinForms Form inside a WPF XAML page.
I have seen examples of putting Windows Forms controls using WindowsFormsHost, but not for integrating a whole form.
Is there a way to do it? The Windows form is hosted inside the WPF application and I'm currently able to load it as a new window but not inside the XAML page.
To put a WinForms form inside a WindowsFormsHost tag in a WPF Form is an error. But you can instantiate a new form from any WPF Project. Here's how:
Say you have two projects "WinFormProj" and "WPFProj". WinFormProj has a form called "Login".
First add a reference in the WPFProj project to WinFormProj.
Then behind any event in any WPFProj element, do this:
var winFormWindow = new WinFormProj.Login();
winFormWindow.Show();
// or
windFormWindow.ShowDialog();
If that won't do, you can convert your WinForms form to a user control which will exist just great in a WindowsFormsHost WPF tag. To do that, it is often as simple as ...
Go to the class declaration and change:
public class Login : Form
to
public class Login : UserControl
Next, in your WPF form, add the WinForms project as an xml namespace:
xmlns:winForms="clr-namespace:WinFormsProj;assembly=WinFormsProj"
And finally, add this to your Grid/StackPanel/Whatever where you want the user control to be hosted:
<WindowsFormsHost Name="LoginControl">
<winForms:LogIn />
</WindowsFormsHost>
Pretty simple once you demystify it.

Resources