| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1678 人关注过本帖
标题:C#开发MSN一样的弹出窗口!
只看楼主 加入收藏
xwghf
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2005-10-11
收藏
 问题点数:0 回复次数:5 
C#开发MSN一样的弹出窗口!
真心诚意求解:

      我想解决这样一个问题,就是用C#写一个WinForm程序。功能实现像QQ一样显示器右下角往上慢慢弹出一个小窗口。这样的功能大家知道怎么做吗?有源码请附地址或发到我的油箱里,或着回贴也行!在线等候!
搜索更多相关主题的帖子: MSN 窗口 开发 
2005-10-11 14:43
wj2051
Rank: 1
等 级:新手上路
帖 子:53
专家分:0
注 册:2005-8-24
收藏
得分:0 
我想知道怎样把窗口最小化到托盘图标中,而不是最小化到任务栏上,双击托盘图标再让窗口还原,就像QQ那样

2005-10-11 15:28
nyzfl
Rank: 1
等 级:新手上路
帖 子:278
专家分:0
注 册:2005-3-21
收藏
得分:0 
x想知道

My-Blog地址:http://fenglin.
2005-10-11 15:56
jimboy
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2005-8-30
收藏
得分:0 
恩,十分想知道

2005-10-11 20:39
唐伯猫
Rank: 8Rank: 8
等 级:贵宾
威 望:45
帖 子:5323
专家分:58
注 册:2005-8-9
收藏
得分:0 
以下是引用wj2051在2005-10-11 15:28:23的发言: 我想知道怎样把窗口最小化到托盘图标中,而不是最小化到任务栏上,双击托盘图标再让窗口还原,就像QQ那样

看看以下的代码是不是类似这样的功能. 注:程序运行后就在右下角 using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data;

namespace TrayIconApp { /// <summary> /// Summary description for Form1. /// </summary> public class TrayIcon : System.Windows.Forms.Form { private System.Windows.Forms.NotifyIcon notifyIcon1; private System.Windows.Forms.ContextMenu contextMenu1; private System.Windows.Forms.MenuItem menuItem1; private System.Windows.Forms.MenuItem menuItem2; private System.Windows.Forms.MenuItem menuItem3; private System.Windows.Forms.MenuItem menuItem4; private System.Windows.Forms.RichTextBox tbox; private System.ComponentModel.IContainer components;

public TrayIcon() { // // Required for Windows Form Designer support // InitializeComponent();

// // TOD Add any constructor code after InitializeComponent call // }

/// <summary> /// Clean up any resources being used. /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); }

#region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(TrayIcon)); this.notifyIcon1 = new System.Windows.Forms.NotifyIcon(this.components); this.contextMenu1 = new System.Windows.Forms.ContextMenu(); this.menuItem1 = new System.Windows.Forms.MenuItem(); this.menuItem2 = new System.Windows.Forms.MenuItem(); this.menuItem3 = new System.Windows.Forms.MenuItem(); this.menuItem4 = new System.Windows.Forms.MenuItem(); this.tbox = new System.Windows.Forms.RichTextBox(); this.SuspendLayout(); // // notifyIcon1 // this.notifyIcon1.ContextMenu = this.contextMenu1; this.notifyIcon1.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon1.Icon"))); this.notifyIcon1.Text = "黄易帖"; this.notifyIcon1.Visible = true; this.notifyIcon1.Click += new System.EventHandler(this.minimise); // // contextMenu1 // this.contextMenu1.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] { this.menuItem1, this.menuItem2, this.menuItem3, this.menuItem4}); // // menuItem1 // this.menuItem1.Index = 0; this.menuItem1.Text = "显示"; this.menuItem1.Click += new System.EventHandler(this.maximize); // // menuItem2 // this.menuItem2.Index = 1; this.menuItem2.Text = "隐藏"; this.menuItem2.Click += new System.EventHandler(this.minimise); // // menuItem3 // this.menuItem3.Index = 2; this.menuItem3.Text = "帮助"; this.menuItem3.Click += new System.EventHandler(this.helpme); // // menuItem4 // this.menuItem4.Index = 3; this.menuItem4.Text = "退出"; this.menuItem4.Click += new System.EventHandler(this.exit); // // tbox // this.tbox.BackColor = System.Drawing.Color.Orange; this.tbox.Dock = System.Windows.Forms.DockStyle.Fill; this.tbox.Location = new System.Drawing.Point(0, 0); this.tbox.Name = "tbox"; this.tbox.Size = new System.Drawing.Size(242, 203); this.tbox.TabIndex = 0; this.tbox.Text = "今日要事\n9:00 与测试处联系测试事宜\n10:00 和电信局客户见面\n14:00 小组讨论数据库设计"; // // TrayIcon // this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.BackColor = System.Drawing.Color.Orange; this.CausesValidation = false; this.ClientSize = new System.Drawing.Size(242, 203); this.ContextMenu = this.contextMenu1; this.ControlBox = false; this.Controls.Add(this.tbox); this.MaximizeBox = false; this.Name = "TrayIcon"; this.ShowInTaskbar = false; this.Text = "黄易帖"; this.TopMost = true; this.WindowState = System.Windows.Forms.FormWindowState.Minimized; this.ResumeLayout(false);

} #endregion

/// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new TrayIcon()); }

private void maximize(object sender, System.EventArgs e) { this.WindowState = System.Windows.Forms.FormWindowState.Normal; if(!this.Visible) { //If the Window is hidden //Show it this.Show(); } }

private void minimise(object sender, System.EventArgs e) { if(this.Visible) { //Hide the Application this.Hide(); } }

private void helpme(object sender, System.EventArgs e) { MessageBox.Show("版权所有:XXX 2001") ; }

private void exit(object sender, System.EventArgs e) { //Call the Dispose Method this.Close(); } } }


<iframe name="alimamaifrm" frameborder="0" marginheight="0" marginwidth="0" border="0" scrolling="no" width="300" height="170" src="/go/app/tbk_app/chongzhi_300_170.php?pid=mm_28854300_2441872_11377541&page=chongzhi_300_170.php&size_w=300&size_h=170&stru_phone=1&stru_game=1&stru_travel=1" ></iframe>
2005-10-11 22:16
wj2051
Rank: 1
等 级:新手上路
帖 子:53
专家分:0
注 册:2005-8-24
收藏
得分:0 
多谢楼上的朋友,我没有表达清楚,不好意思,我不是要通过选项来隐藏窗体,我的意思是按了窗口右上方的关闭按钮后实现隐藏,现在我已经知道了,重写OnClosing事件就行了。

[此贴子已经被作者于2005-10-12 10:53:34编辑过]



2005-10-12 10:53
快速回复:C#开发MSN一样的弹出窗口!
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.017506 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved