I'm trying to use Webkit-Sharp to implement a simple HTML browser in my application. I'm using Microsoft Visual C# Express Edition with the hopes of eventually moving the code over to Linux under Mono.
My first step was to add references to all of the Webkit dll files.
Next, I went and added the WebKitBrowser controls to the toolbox in the standard way and dropped a WebKitBrowser control on my form (specifically, on a TabPage.
I added the needed using statements of using WebKit; and using Webkit.Interop; to my declarations. My webkitBrowser control is called myBrowserControl. As I understand it, I should be able to do things like
myBrowserControl.Navigate('http://www.google.com');
and the browser should take me to Google's homepage. But, for some reason, it doesn't understand what WebkitBrowser is. In my Form Designer code, I have the following line:
private WebKit.WebKitBrowser myBrowserControl;
and I am being told that WebKitBrowser doesn't exist in the WebKit namespace and I may be missing a reference to an assembly. But it doesn't seem like I am. Can anyone help me figure this out? I know I'm doing something simple wrong but I can't figure out what.
Thanks
Just posting in case someone else finds this.
Were you trying to drop a WebKit gtk control into a Winforms project? That doesn't work. You might possibly be able to do this if you're using gtk on windows, although I've heard no one has had any success getting webkit-sharp working in windows.
You could actually use the winforms browser control in windows, since there is a (now unsupported) winforms port in mono.
Related
I was searching for controls that my replace MS Word functionallity in my ASP .NET Web Forms website. I found TX Text Control. I implemented it trial version in application, and it works well but for some strange reason license didn't work. I am getting error: System.ComponentModel.LicenseException: The following control could not be licensed. I set up everythink properly, becouse in fresh ASP .NET project this control works without any problem. Other controls which requires license like Progress Telerik works perfectly in this project. I contacted TX support but they could not help me. Maybe someone had similar issue and know the answer for my problem. Or maybe someone know other good control that could replace MS Word functionallity.
I'm trying to use Coded UI Test (Visual C#) to test a Java client application and I am quite new to this.
Currently I have built enough to enter the set client which is built in Java. My problem is that it seems that I cannot use the UIMap Coded UI Test Builder to select any buttons within the application. When using the Assertions it selects the entire window instead of single buttons within the GUI.
I would rather code to reach my solution than using the UIMap recorder but unfortunately I cannot seem to find what I'm looking for.
I have searched long and far for a way to do this, and cannot find anything relevant, so please help!
You can use tools like Sikuli...open source image recongition or EggPlant (not free).
We actually integrated sikuli in VS there is a library called SikuliIntegrator (SikuliModule.dll)
Or try anther tool like QTP or other open source to see if they can capture the controls better.
If the Java application you are testing is built by you or your team, you may ask them to change the architecture such that CodedUI could grab the controls...
I am trying to create a new Control (Let us for now forget about UserControl or CustomControl).
I open a Windows phone Application project in vs2010 and then add a new item Windows phone Control Library and then I use it in my phone application.
Everything works fine. Now if I want to create a windows phone control to be used in another application how should I be going about it? New application means a separate new solution.
Phone Application1 -> Have my own control inside the solution and hence I am able to use it.
How can I use this same control in another new solution?
I am not sure if this has been answered before. Does any solution already exist?
Cavet:
I tried creating a new Windows phone Class Library in a vs2010 instance but it didn't work because it didn't had a xaml form. When I tried to manually include it and write the logic it build successfully but now even if I include the dll of this project I don't get the control in the toolbox. This process does not make much sense to me as I am creating a class library and not a control but still wanted to give it a try.
To show controls from your assembly in the toolbox, you should do design-time assembly. You can look at these articles for the beginning:
Link2
Link1
It's not easy and perhaps you can live without that if your control assembly is not a commercial product. To use any control from other assembly in application:
add project reference to your control assembly
include xmlns namespace attribute corresponding to your assembly to any page of your application. Just start typing 'xmlns=' near other xmlns definitions in the page header and VS intellisense will show you the list of available namespaces. Choose the needed one and then set namespace alias to use on the page. It should look something like xmlns:myNamespace="clr-namespace:MyAssembly.Namespace.;assembly=MyAssembly"
insert control from your assembly into page using xaml editor
now you should be able to see your control in xaml designer and edit its properties from the property grid
.
I am not sure if the above mentioned method would solve the case, because as far as I have seen it is not possible to create a Windows Phone Control Library in VS2010. So this is what I did..
Created a Windows Phone Control Library and write my own custom control.
Build the project.
Back to Vs2010, added the reference to the control in the app in which I wish to use.
As simple as that. I don't know why it was initially a little bit confusing (perhaps I would have got confused with the binding and stuff). Anyways its quite simple though. Thank you for the reply.
How does Visual Studio and other similar programs display a form in their IDE?
Is it possible to achieve the same or a similar effect using C# or VB.NET?
Please see the picture below to get what I mean.
If you are talking about hosting a Winforms editor in your code, it is entirely possible and is actually built in to the .NET framework!
The Essence is the IDesignerHost interface. The whole system is complicated, but can be done (I have done it in production code for runtime layout configuration editing). There is a sample of code from Microsoft here.
I'm sure if you search fir 'IDesignerHost' you'll find enough reference material to figure it out.
Are you speaking about UI creating tools?
Refer to http://www.icsharpcode.net/opensource/sd/ - SharpDevelop for deep dive. It's open sourse, so you'll be able to find out more details.
I believe what you want is a multiple document interface (MDI) see http://msdn.microsoft.com/en-us/library/ms973874.aspx for more info.
how do I enable visual styles when my project is a class library and it's being loaded into a program that does not have Application.EnableVisualStyles() set. I have been struggling with this for 2 days now. This is in C# (I've seen some examples for older C++ and some things that may work for VB, but nothing has been clearly laid out for C# and if it's even possible).
I have tried to run Application.EnableVisualStyles() from my Class Library before creating any controls, but it seems that needs to be done before an Application.Run() is done, and I don't have control when an Application.Run() is called since this is going into a 3rd party app as a plugin (VMware's Virtual Infrastructure Client).
I have tried to create a manifest file and after compiling the class library I link in the manifest file to my ProgressBar.dll with:
mt.exe -manifest ProgressBar.dll.manifest -outputresource:ProgressBar.dll;2
Except this doesn't work. If I make a dummy Application that uses my ProgressBar class library and link the manifest to that Application's exe, then the visual styles come up (basically it's doing the long way of specifying the Manifest file in the Project Properties, Application section).
Right now my buttons look ugly, but the biggest thing that is irritating is that the ProgressBar control doesn't work in Marquee style. I'm very soon going to have to resort to making my own Marquee-style ProgressBar or just throwing in an animated GIF in it's place. With regards to the buttons, I guess I can start using Infragistics buttons in order to get a more consistent result.
Please and thanks as always!
How can you be sure that there are no controls created yet when you call Application.EnableVisualStyles? Created does not necessarily mean that the controls are also visible on a form.
Since you are working with a closed 3rd-party component I would invest my time rather in creating my own controls if the look and feel is that important.
You'll have to use the OpenThemeData Win32 api in your control:
MSDN: Using Windows XP Visual Styles