Posts tagged WinForms
Extend a webbrowser control using ICustomQueryInterface
- 20 March 2023
This article is written with the help of ChatGPT. I want to see how far ChatGPT can go solve this and if any correction needs to be made. ChatGPT went pretty far but still made some mistakes.
To extend a WebBrowser control using ICustomQueryInterface, you can create a new class that implements the ICustomQueryInterface interface and then use the SetSite method of the WebBrowser control to set the new class as the site for the control. Here are the steps you can follow:
Getting around “Strong name signature not valid for assembly” for a ClickOnce application
- 10 January 2017
When building a ClickOnce application, I need to redistribute a third party dll. But it failed the strong name validation under sn-vf thus ClickOnce launcher failed with the same error.
Microsoft (R) .Net Framework Strong Name Utility Version 4.0.30319.0 Copyright (c) Microsoft Corporation. All rights reserved.
Howto: Ignoring web browser certificate errors in a webbrowser host
- 17 July 2013
Download Example Code: jiangsheng/Samples.
Many applications host webbrowser controls to display web pages inside. Before production the web page is often in an internal server that do not have a valid certificate. This article let you skip the certificate error and continue testing your application
How to: Migrating a CLR console Visual C++ project to Windows Forms
- 17 December 2012
Note: Windows Forms programming in new development is discouraged by Microsoft at this point as Microsoft wants to make full use of hardware accelerated drawing instead of using the CPU-intensive GDI. But maintaining old Windows Forms code in Visual C++ 2012 is still supported, GDI isn’t going anywhere anytime soon.
Visual C++ 2012 removed the Windows Forms project template and I see people scramble to find ways to create a Windows Forms project. There is a walkaround that’s been around for years, that is, to convert a CLR console application to a Windows one, then add forms related code to the project.
示例:在MFC程序中集成.Net中的控件
- 19 March 2005
从.Net Framework 1.1开始,.Net控件可以以ActiveX的方式被集成到非托管宿主中——但是官方的支持只对于使用托管C++的MFC程序。Chris Sells在2003年3月份的MSDN杂志中描述了这样一个示例(https://web.archive.org/web/20030304083154/http://msdn.microsoft.com/msdnmag/issues/03/03/WindowsForms/default.aspx)。这个示例使用的代码稍微繁琐,而且没有描述如何处理控件的事件。MFC 8.0增加了一系列这方面的支持来把这个集成过程简单化(参考http://msdn2.microsoft.com/en-us/library/ahdd1h97.aspx)。这使得在MFC程序中使用.Net中的一些比较好用的类,例如System::Windows::Forms::PropertyGrid比以前容易多了。
举例来说,要在MFC的基于对话框的程序中使用System::Windows::Forms::PropertyGrid控件,首先创建一个基于对话框的程序,添加必要的引用:
WinForm
- 28 April 2004
今天一口气看完了WinForm Quick Start(http://samples.gotdotnet.com/quickstart/winforms/)
发现.Net使一切变得简单,以前需要大量代码的docking现在只需要一句话