C# Active控件,并触发javascript事件
创建一个Winform用户控件 UserControl1
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;
using System.Reflection;
namespace MyActiveTest
{
[ComVisible(true)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ComSourceInterfaces(typeof(UserControl1Events))]
[Guid("B0CF6712-4798-424d-8D08-A1E1E2F53B74")]
public partial class UserControl1 : UserControl, IObjectSafety
{
public delegate void SubmitClickedHandler();
public event SubmitClickedHandler SubmitClicked;
public UserControl1()
{
InitializeComponent();
}
//
private string _mymessage;
public string Mymessage
{
get { return _mymessage; }
set { _mymessage = value; }
}
string _param = "http://www.163.com";
public string Param
{
get
{
return _param;
}
set
{
_param = value;
}
}
private void button1_Click(object sender, EventArgs e)
{
MessageBox.Show(_mymessage);
if (SubmitClicked != null)
// _param = "这是一个测试的文件";
SubmitClicked();
}
public void ttMessageBox()
{
MessageBox.Show("sdsdfsd");
}
#region IObjectSafety 成员
public void GetInterfacceSafyOptions(int riid, out int pdwSupportedOptions, out int pdwEnabledOptions)
{
pdwSupportedOptions = 1;
pdwEnabledOptions = 2;
}
public void SetInterfaceSafetyOptions(int riid, int dwOptionsSetMask, int dwEnabledOptions)
{
//throw new Exception("The method or operation is not imple
相关文档:
这个地方就是为什么它的String类型不直接提供一个trim方法呢?
为什么每次都要写这样一句话呢?
String.prototype.trim=function(){return this.replace(/(^\s*)|(\s*$)/g,"");}
这样有意思吗?
JavaScript中规定一个这样的方法会死啊? ......
已知有一个XML文件(bookstore.xml)如下:
<?xml version="1.0" encoding="gb2312"?>
<bookstore>
<book genre="fantasy" ISBN="2-3631-4">
&n ......
实现步骤:
1.自定义一个Java类,该Java类中定义一个方法来包含需要被运行的代码。
2.动态编译刚刚生成的Java源码,不在磁盘上生成源码,而是直接编译内存中的Java源码。
3.动态加载刚刚创建编译的Java二进制码,编译好的Java二进制码不是在磁盘上,而是放在内存中,并定义自己的类加载器,负责加载内存中的class文件。
......
40个轻量级JavaScript库介绍
流行 JavaScript 库不胜枚举jQuery, MooTools, Prototype, Dojo, YUI这些 JavaScript 库功能丰富加上它们插件几乎能胜任任何工作然而这有代价这些库往往导致你网页尺寸臃肿某些场合如果你只想完成特定工作可使用一些功能更专一轻量库本文介绍了40个非常出色轻量级 JavaScript 库
......