|登录 |注册

查看: 4375|回复: 16
打印 上一主题 下一主题

ASP.NET问题。。

 关闭 [复制链接]
AhPang
2008-11-17 09:54 PM
请问ASP.NET C#里可以像VB.NET那样使用MouseMove或其他VB.NET的Events吗?
如果可以要怎样做呢?
goodday
2008-11-18 10:17 AM
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace @event
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {

        }
    }
}

看到   InitializeComponent();   吗???



安show all files

在安 form1.designer.cs

全部的  InitializeComponent();   收在里头



看到intellesense 了吗??



  1.    /// <summary>
  2.         /// Required method for Designer support - do not modify
  3.         /// the contents of this method with the code editor.
  4.         /// </summary>
  5.         private void InitializeComponent()
  6.         {
  7.             this.button1 = new System.Windows.Forms.Button();
  8.             this.SuspendLayout();
  9.             //
  10.             // button1
  11.             //
  12.             this.button1.Location = new System.Drawing.Point(82, 102);
  13.             this.button1.Name = "button1";
  14.             this.button1.Size = new System.Drawing.Size(75, 23);
  15.             this.button1.TabIndex = 0;
  16.             this.button1.Text = "button1";
  17.             this.button1.UseVisualStyleBackColor = true;
  18.             this.button1.Click += new System.EventHandler(this.button1_Click);
  19.             //
  20.             // Form1
  21.             //
  22.             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
  23.             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
  24.             this.ClientSize = new System.Drawing.Size(284, 264);
  25.             this.Controls.Add(this.button1);
  26.             this.Name = "Form1";
  27.             this.Text = "Form1";
  28.             this.ResumeLayout(false);

  29.         }
复制代码




自己找找看
AhPang
2008-11-18 09:17 PM
谢谢你宝贵的资料,明天我去公司testing.
AhPang
2008-11-19 09:36 PM
好日子版主,我试过你的guide了好像只能用在windows application,web form好像不行。
goodday
2008-11-19 10:30 PM




上面的 web 的

但mouse move 啊

只有指定的 能而已


Event HandlersNew to HTML 4.0 was the ability to let HTML events trigger actions in the browser, like starting a JavaScript when a user clicks on an HTML element. Below is a list of the attributes that can be inserted into HTML tags to define event actions.
FF: Firefox, N: Netscape, IE: Internet Explorer
AttributeThe event occurs when...FFNIEonabortLoading of an image is interrupted134onblurAn element loses focus123onchangeThe user changes the content of a field123onclickMouse clicks an object123ondblclickMouse double-clicks an object144onerrorAn error occurs when loading a document or an image134onfocusAn element gets focus123onkeydownA keyboard key is pressed143onkeypressA keyboard key is pressed or held down143onkeyupA keyboard key is released143onloadA page or an image is finished loading123onmousedownA mouse button is pressed144onmousemoveThe mouse is moved163onmouseoutThe mouse is moved off an element144onmouseoverThe mouse is moved over an element123onmouseupA mouse button is released144onresetThe reset button is clicked134onresizeA window or frame is resized144onselectText is selected123onsubmitThe submit button is clicked123onunloadThe user exits the page123

请看下面的参考

http://www.w3schools.com/jsref/jsref_events.asp
gsem980
2008-11-30 11:18 AM
板主你好利害啊. 你是神吗?

回复 #6 gsem980 的帖子

goodhermit95
2008-12-24 04:59 PM
ASP.NET 原来可以这样啊,可以像WinForm那样的
goodday
2008-12-25 01:03 AM
没差什么的 只是 state control 不同而已
学 一个 vb.net 会完全部的 winform  webform mobileform

回复 #8 goodday 的帖子

goodhermit95
2008-12-25 11:09 AM
那么划算啊em0036
叮当梦
2009-1-19 01:47 AM
厉害!em0012
InitializeComponent(); 是用来做什么的?
对window based project 没有什么头绪
您需要登录后才可以回帖 登录 | 注册

JBTALKS.CC |联系我们 |隐私政策 |Share

GMT+8, 2025-4-17 04:25 PM , Processed in 0.113233 second(s), 25 queries .

Powered by Discuz! X2.5 © 2001-2012 Comsenz Inc.

本论坛言论纯属发表者个人意见,与本论坛立场无关
Copyright © 2003-2012 JBTALKS.CC All Rights Reserved

Dedicated Server powered by iCore Technology Sdn. Bhd.

合作联盟网站:
JBTALKS 马来西亚中文论坛 | JBTALKS我的空间 | ICORE TECHNOLOGY SDN. BHD.
回顶部