wb 是 拖放在窗体上的 System.Windows.Forms.WebBrowser 在你的窗体代码中定义 SHDocVw.WebBrowser_V1 wb1; 在 你窗体的 load 事件中 加入下面的代码 wb1 = wb.ActiveXInstance as SHDocVw.WebBrowser_V1; wb1.NewWindow += wb1_NewWindow; 处理事件: void wb1_NewWindow(string URL, int Flags, string Targe…
参考 [完美]原生JS获取浏览器版本判断--支持Edge,IE,Chrome,Firefox,Opera,Safari,以及各种使用Chrome和IE混合内核的浏览器 利用js来判断 namespace WindowsFormsApp1 { public partial class Form1 : Form { public Form1() { InitializeComponent(); //webBrowser1.Navigate(@"C:\Users\admin\Desktop\test.…
最近做一个winform项目,在里面用了webbrowser控件进行html文档打印,遇到了标题所示问题.根据查到的一些资料,在调试>异常>查找中输入“System.Runtime.InteropServices.COMException”,勾选查找到的项目后的复选框.重新调试程序,终于爆出了真正的问题:试图吊销一个未注册的拖放目标 (异常来自 HRESULT:0x80040100 (DRAGDROP_E_NOTREGISTERED)). 查看原来的代码: browser.DocumentTe…
System.Windows.Forms在system.windows.forms.dll中.需要添加引用.在解决方案资源管理器中的引用上单击右键,选择添加引用.找到System.windows.forms…
#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll #endregion using System.Collections; using System.ComponentModel; using Syst…
WPF中实例化Com组件,调用组件的方法时报System.Windows.Forms.AxHost+InvalidActiveXStateException的异常 在wpf中封装Com组件时,调用组件的方法时抛出异常System.Windows.Forms.AxHost+InvalidActiveXStateException的异常. 通过网上查询发现,除了实例化com组件,还要将该对象进行初始化. 添加如下代码后 System.Windows.Controls.Grid CTSGrid = n…
private void CopyAndOverwriteMap() { //IObjectCopy接口变量申明 IObjectCopy objectCopy = new ObjectCopyClass(); //要Copy的对象 object toCopyMap = m_mapControl.Map; //复制要复制的对象 object copiedMap = objectCopy.Copy(toCopyMap); //要复制到的文件 object toOverwriteMap = axPag…
一:C#在父窗口中调用子窗口的过程(无法访问已释放的对象)异常 其实,这个问题与C#的垃圾回收有关.垃圾回收器管 理所有的托管对象,所有需要托管数据的.NET语言(包括 C#)都受运行库的 垃圾回收器的制约.垃圾回收器可以确定运行垃圾回收的最佳时间,自动进行垃圾回收.然而垃圾回收的一个产物是:C#对象没有 确定性毁 坏.所以会出现子窗口对象已被销毁,但又不为null,故出现访问时产生“未处理 ObjectDisposedException”异常 如下操作: 二:不存在从对象类型System.Wi…
using System.Windows.Forms.DataVisualization.Charting; 编译时报警:命名空间"System.Windows.Forms"中不存在类型或命名空间名称"DataVisualization"(是缺少程序集引用吗?) 解决办法: 引用中添加引用: 本文摘自木庄网络博客>>命名空间"System.Windows.Forms"中不存在类型或命名空间名称"DataVisualizati…
最近有个项目要用到System.Windows.Forms.dll,在Unity编辑器里用着还好好的,但是一导出就给我报错,让我十分不爽. 于是请教百度,搜出了五花八门的答案,没一个能解决我的问题的,更不爽了! 好在功夫不负有心人终于找到了靠谱的答案.(原链接) 只需要File->Build Settings->Player Settings...->Player->Other Settings.找到标黑的Configuration,将其中的Api compatibility Le…
“ToolTip”是“System.Windows.Forms.ToolTip”和“DevComponents.DotNetBar.ToolTip”之间的不明确的引用 ,在编程时,有时候会编译出现不明确的引用,这时候可以把Tootip写成标准的格式就可以了 比如: ToolTip tip = new ToolTip();            {                var msg = "你是一个中国人";                tip.IsBalloon = tru…
[实例简介] 涵盖了几种常用的 webBrowser执行javascript的方法,详见示例截图以及代码 [实例截图] [核心代码] execScript方式: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 using mshtml; using System; using System.Collections.Generic; using…
System.Windows.Forms.Timer执行的时候,如果你在过程中间加一个sleep整个的界面就死掉了,但是另外两个没有这个情况,System.Timers.Timer.System.Threading.Timer!System.Timers.Timer.System.Threading.Timer这两个平时用的时候没有发现太大的区别,定时的精度都差不多.一般我个人用的话,还是用的System.Threading.Timer比较多,用编程的方法比较好用!System.Windows.…
System.Windows.Forms.Timer.System.Timers.Timer.System.Threading.Timer的 区别和用法http://space.itpub.net/12639172/viewspace-571197 http://msdn.microsoft.com/en-us/magazine/cc164015.aspx ================================================== System.Windows.Form…
.NET Framework里面提供了三种Timer: System.Windows.Forms.Timer System.Timers.Timer System.Threading.Timer VS.Net 2005默认只有一个Timer控件,但那是System.Forms.Timer控件.如果要使用System.Timers.Timer的控件,需要在工具箱上单击右键,手动添加. 添加的步骤:工具箱单击右键->Add Item->找到命名空间是System.Timers.Timer的控件,将…
这个案例指在介绍微软这套免费又功能强大的图表控件Microsoft Chart Controls for Microsoft .NET Framework 3.5,通过它,可让您的项目及报表,轻松套用各种功能强大的 2D.3D.实时变化的动态图表:且透过 AJAX,可让图表及里面的数据,每秒钟都持续更新:使用者透过浏览器,可和图表做各种互动设定 下面结合BBVS项目中温度功能模块中温度曲线的绘制 做了如下Demo,供大家学习微软的这款功能强大的图标控件,这里只是起一个抛砖引玉的作用,更多更好玩的…
一.主要属性.方法和事件 Windows 窗体 Timer 是定期引发事件的组件.该组件是为 Windows 窗体环境设计的. 时间间隔的长度由 Interval 属性定义,其值以毫秒为单位.若启用了该组件,则每个时间间隔引发一个 Tick 事件. 这是添加要执行的代码的位置. Timer 组件的主要方法包括 Start 和Stop,这两种方法可打开和关闭计时器.计时器在关闭时重置:不存在暂停 Timer 组件的方法. 二.Windows 窗体 Timer 组件的 Interval 属性的限制…
调用System.Windows.Forms DLL 首先在Unity新建Plugins文件夹添加System.Windows.Forms.dll 然后代码中添加引用 using System; using UnityEngine; using System.Collections; using System.Collections.Generic; using System.Windows.Forms; using System.IO; public class FileMenu : Mono…
原文:[C#遗补]获取应用程序路径之System.IO.Directory.GetCurrentDirectory和System.Windows.Forms.Application.StartupPath的区别 .Net Framework中,System.IO.Directory.GetCurrentDirectory()方法用于获得应用程序当前工作目录如果使用此方法获得应用程序所在的目录,应该注意:System.IO.Directory.GetCurrentDirectory()方法获得的目…
#region 程序集 System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll #endregion using System.Collections; using System.ComponentModel; using Syst…
System.Windows.Forms.Timer 基于窗体应用程序 阻塞同步 单线程 timer中处理时间较长则导致定时误差极大. System.Timers.Timer 基于服务 非阻塞异步 多线程 /// <summary> /// windows定时器 /// </summary> System.Windows.Forms.Timer _wTimer; /// <summary> /// 应用程序生成定时器 /// </summary> Syste…
示例一:在webView中调用js脚本进行搜索 1.首先导入JavaScriptCore.framework这个框架 2.创建webView.设置代理.请求手机端百度 #import "ViewController.h" #import <JavaScriptCore/JavaScriptCore.h> #define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width #define SCREEN_HEIGHT [UI…
原因是DataGridView中列的Name属性值和DataPropertyName属性值一样,比如Name="CardID",DataPropertyName="CardID",这样会出现 :错误 128 无法将类型“string”隐式转换为“System.Windows.Forms.DataGridViewTextBoxColumn”…
多线程程序中,新创建的线程不能访问UI线程创建的窗口控件,这时如果想要访问窗口的控件,发现无法对其控制. 这时可将窗口构造函数中的CheckForIllegalCrossThreadCalls设置为false:然后就能安全的访问窗体控件. 如果捕获了对错误线程的调用,则为 true:否则为 false. --------------------------------- System.Windows.Forms.Control.CheckForIllegalCrossThreadCalls =…
在开发过程中,基本都需要实现帮助功能,而一般帮助功能就是打开一个帮助文档,System.Windows.Forms提供了Help类用于打开帮助文档,挺方便的. Help类提供的方法如下:   Name Description Equals(Object) Determines whether the specified object is equal to the current object. (Inherited from Object.) Finalize Allows an object…
Firebug中调试中的js脚本中中文内容显示为乱码 设置 页面 UFT-8 编码没用, 解决方法:点击 "Firebug"工具栏 中的"选项"---"重置所有FireBug选项"即可正常使用…
用户控件的设计要点 最近的项目中有一个瀑布图(彩图)的功能,就是把空间和时间上的点量值以图的形式呈现出来,如下图: X坐标为空间,水平方向的一个像素代表一个空间单位(例如50米) Y坐标为时间,垂直方向的一个像素代表一个时间单位(例如1秒) 由于没有现成的彩图控件可以使用,于是就自己尝试的写了一个用户控件,这篇博客就是讲述了如何编写一个类似的用户控件. 该用户控件使用了自绘制的功能,其实要实现自绘制还是比较容易的,按以下的几个步骤即可: 1,创建一个继承自 System.Windows.Form…
一旦运行就显示:“FormCRUD.csProj.FormMain.Name”隐藏了继承的成员“System.Windows.Forms.Control.Name”.如果是有意隐藏,请使用关键字 new. 定位错误是在:this.Text="FormMain"; 后来才知道是调试模式的问题,我当时是把调试模式切换到 release 现在切换回 debug就没有问题了. 这只是治标,后来发现时因为所取的名字‘Name’与“FormMain”的名字'Name'重名了,所以才报的错.…
using System; using System.ComponentModel; using System.Globalization; using System.Runtime; using System.Runtime.InteropServices; using System.Threading; namespace System.Windows.Forms { [DefaultEvent("Tick"), DefaultProperty("Interval&quo…
问题:将dotnet framework 4.0 切换到2.0时,编译没有问题,在运行时出现如下错误:System.InvalidCastException: 无法将类型为“System.Windows.Forms.SplitContainer”的对象强制转换为类型“System.ComponentModel.ISupportInitialize”. 解决方法: 注释掉如下代码(此代码为设计器自动生成代码) //((System.ComponentModel.ISupportInitialize…