Winform MDI窗体容器 权限 简单通讯
MDI窗体容器 权限

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;
using WindowsFormsApplication1.App_Code; namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1(Users u)
{
InitializeComponent(); if (!u.pre.Contains("1"))
{
销售ToolStripMenuItem.Visible = false;
} if (!u.pre.Contains("2"))
{
仓库ToolStripMenuItem.Visible = false;
} if (!u.pre.Contains("3"))
{
财务ToolStripMenuItem.Visible = false;
} if (!u.pre.Contains("4"))
{
综合管理ToolStripMenuItem.Visible = false;
} } private void 销售ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form2 f2 = new Form2(); f2.WindowState = FormWindowState.Maximized; f2.FormBorderStyle = FormBorderStyle.None; f2.MdiParent = this; f2.Parent = panel1; f2.Show();
} private void Form1_SizeChanged(object sender, EventArgs e)
{
foreach (var c in panel1.Controls)
{
if (c is Form2)
{
(c as Form2).WindowState = FormWindowState.Normal;
(c as Form2).WindowState = FormWindowState.Maximized;
} }
} private void 仓库ToolStripMenuItem_Click(object sender, EventArgs e)
{
Form3 f2 = new Form3(); f2.WindowState = FormWindowState.Maximized; f2.FormBorderStyle = FormBorderStyle.None; f2.MdiParent = this; f2.Parent = panel1; f2.Show();
} }
}

简单通讯

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;
using tongxun.App_Code;
using WindowsFormsApplication1.App_Code; namespace tongxun
{
public partial class Form3 : Form
{
Users F = null;
Users T = null; public Form3(Users from, Users to)
{
InitializeComponent(); label1.Text = from.UserName;
label2.Text = to.UserName; F = from;
T = to;
} private void button1_Click(object sender, EventArgs e)
{
Context c = new Context();
c.from = label1.Text;
c.to = label2.Text;
c.txt = richTextBox2.Text;
c.state = false; new ContextData().Insert(c); richTextBox1.Text += F.NickName + "对" + T.NickName + "说:\r";
richTextBox1.Text += richTextBox2.Text + "\r\n";
richTextBox2.Text = "";
}
List<Context> cclist = new List<Context>();
private void timer1_Tick(object sender, EventArgs e)
{
cclist = new ContextData().Select(T.UserName, F.UserName); if (cclist.Count > 0)
{
foreach (var c in cclist)
{
richTextBox1.Text += c.from + "对" + c.to + "说:\r";
richTextBox1.Text += c.txt + "\r\n"; new ContextData().Update(c);
}
}
} }
}

Winform MDI窗体容器 权限 简单通讯的更多相关文章
- Winform MDI窗体容器、权限、简单通讯
MDI窗体容器: 一般来说,窗体是顶级容器,不允许放在其他任何容器内,但是如果将某个窗体的IsMdiContainer属性设置为True,那此窗体就会成为窗体容器,可以在其中放入其他窗体 在内部的窗体 ...
- Winform MDI窗体容器,权限以及简单通讯
MDI窗体容器: 一般来说,窗体是顶级容器,不允许放在其他任何容器内,但是如果将某个窗体的IsMdiContainer属性设置为True,那此窗体就会成为窗体容器,可以在其中放入其他窗体 在内部的窗体 ...
- MDI窗体容器 权限设置
MDI窗体容器:它可以让其它窗体在它的内部打开,无法超出它的范围将某个窗体的属性:IsMdiContainer设置为true - 窗口样式如何将其它窗体在它的内部打开?窗体对象名.MdiParent ...
- winform(MDI窗体容器、权限设置)
一.MDI窗体容器: 1.功能: 它可以让其它窗体在它的内部打开,无法超出它的范围 将某个窗体的属性:IsMdiContainer设置为true - 窗口样式 2.问题: (1)如何将其它窗体在它的内 ...
- MDI窗体容器、权限设置
一.MDI窗体容器: 1.功能: 它可以让其它窗体在它的内部打开,无法超出它的范围 将某个窗体的属性:IsMdiContainer设置为true - 窗口样式 2.问题: (1)如何将其它窗体在它的内 ...
- MDI窗体容器和权限设置.avi
一.MDI窗体容器 MDi窗体是装Form的容器.平常Form(窗体)就是平常展示的最高级别,但是MDI比Form还高级.它可以让其它窗体在它的内部打开,无法超出它的范围 1 创建:将某个窗体的属性: ...
- 【2017-05-03】winform打印控件、事件对象和事件数据、MDI窗体容器
一.打印控件 第一步先把打印对象搞出来. - printDocument 打印对象(将要打印的内容放到该对象里,从该对象里取内容打印) 设置他的PrintPage事件(对于要打印的每一页触发一次 ...
- MDI窗体容器--2016年12月15日
MDI窗体容器 多文档界面(Multiple-Document Interface)简称MDI窗体.MDI窗体用于同时显示多个文档,每个文档显示在各自的窗口中.MDI窗体中通常有包含子菜单的窗口菜单, ...
- winform窗体 控件【MDI 窗体容器】
MDI :窗体容器 -- 在窗体中放置窗体 属性 IsMdiContainer : 是否是窗体 -- 只有 Form 有此属性 Form2 f2 = new Form2(); ...
随机推荐
- linq实现数组转符号分割的字符串(备忘)
fitemidstr = string.Join(",", detailpre1.Select(i => i.Key.ToString()).ToArray());
- 【翻译】如何给tomcat配置memcached-session-manager
原文在这 ,其实不是忠实翻译,就是按照自己理解记录一下 第一步,下载所需的jar包 下载 memcached-session-manager-x.y.z.jar, memcached-session- ...
- javascript 函数重载 overloading
函数重载 https://en.wikipedia.org/wiki/Function_overloading In some programming languages, function over ...
- 替换jenkins上打包完成的安装包的方法
修改 /root/.jenkins/jobs/Item名称/lastSuccessful/archive/*/obj 文件夹下的文件,就可以在下图二中下载新修改的文件,需要注意的是,此文件夹下不能有新 ...
- Leetcode: Minimum Unique Word Abbreviation
A string such as "word" contains the following abbreviations: ["word", "1or ...
- REM 布局
1.rem是什么? rem(font size of the root element)是指相对于根元素的字体大小的单位 2.为什么web app要使用rem? 实现强大的屏幕适配布局(淘宝,腾讯,网 ...
- centos7 tomcat service 自启动
第一步: vim /lib/systemd/system/tomcat.service 第二步:复制以下代码保存退出,注意修改你的tomcat路径 [Unit] Description=tomcat ...
- JSON.stringify////////////////////////////////zzzzzzzzzzzzzz
JSON.stringify 语法实例讲解 可能有些人对系列化这个词过敏,我的理解很简单.就是说把原来是对象的类型转换成字符串类型(或者更确切的说是json类型的).就这么简单.打个比方说,你有一个类 ...
- qq
引用:http://blog.sina.com.cn/s/blog_9e2e84050101blqz.html 腾讯QQ使用何种开发平台? 腾讯QQ的开发分客户端软 ...
- select in 在postgresql的效率问题
在知乎上看到这样一个问题: MySQL 查询 select * from table where id in (几百或几千个 id) 如何提高效率?修改 电商网站,一个商品属性表,几十万条记录,80M ...