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
相关文档:
匿名函数
函数是JavaScript中最灵活的一种对象,这里只是讲解其匿名函数的用途。匿名函数:就是没有函数名的函数。
1、函数的定义,首先简单介绍一下函数的定义,大致可分为三种方式
第一种:这也是最常规的一种
function double( x ){
return 2 * x;
}
第二种:这种方法使用了Func ......
定义方法:
1、用构造函数RegExp
2、直接量,包含在一对(/)之间的字符
直接量字符:
字母数字字符——自身
\o——NULL字符
\t——制表符
\n——换行符
\v——垂直制表符
\f——换页符
\r——回车符 ......
第一种
<%=RetInfo("DB","数据库") %>
<%=RetInfo("YX_UpFile","上传文件") %>
<%=RetfileInfo("Include/", "广告")%>
//从前台调用后台方法
//从前台调用后台的方法..并向其方法传入不同的参数!
第二种
<ItemTemplate >
<%#Ret_stat(Convert.ToInt16(Eval("YX_Stat1")), "热点")%>
......
web开发中有时需要对输入框中的时间(主要是开始时间和结束时间)进行比较,网上搜索了一番,发现有不少是无效的,以下方法经小弟检验确实有效,特此共享。(请关注红色部分)
function ValidtorTime(){
var d1 = new Date(document.getElementById('txbfromDate').value.replace(/\-/g, "\/"));
var d2 = new Date(do ......
40个轻量级JavaScript库介绍
流行 JavaScript 库不胜枚举jQuery, MooTools, Prototype, Dojo, YUI这些 JavaScript 库功能丰富加上它们插件几乎能胜任任何工作然而这有代价这些库往往导致你网页尺寸臃肿某些场合如果你只想完成特定工作可使用一些功能更专一轻量库本文介绍了40个非常出色轻量级 JavaScript 库
......