| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 637 人关注过本帖
标题:自己做的 线控件(SingleLine)
只看楼主 加入收藏
Theron
Rank: 1
等 级:新手上路
帖 子:127
专家分:0
注 册:2006-9-23
收藏
 问题点数:0 回复次数:2 
自己做的 线控件(SingleLine)
sCFMoGH1.rar (17.06 KB) 自己做的 线控件(SingleLine)


[此贴子已经被作者于2006-9-24 16:04:07编辑过]



17EQ4Zwo.jpg (12.27 KB)
图片附件: 游客没有浏览图片的权限,请 登录注册
搜索更多相关主题的帖子: SingleLine 控件 
2006-09-24 16:02
Theron
Rank: 1
等 级:新手上路
帖 子:127
专家分:0
注 册:2006-9-23
收藏
得分:0 

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;

namespace Sep_24_SingleLine
{
public partial class SingleLine : UserControl
{
public SingleLine()
{
InitializeComponent();
}

public int Length
{
get
{ return label1.Size.Width; }
set
{ label1.Size = new Size(value, label1.Size.Height); }
}

private void SingleLine_SizeChanged(object sender, EventArgs e)
{
label1.Size = new Size(this.Size.Width - 5, label1.Size.Height);
}
}
}


namespace Sep_24_SingleLine
{
partial class SingleLine
{
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.IContainer components = null;

/// <summary>
/// 清理所有正在使用的资源。
/// </summary>
/// <param name="disposing">如果应释放托管资源,为 true;否则为 false。</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}

#region 组件设计器生成的代码

/// <summary>
/// 设计器支持所需的方法 - 不要
/// 使用代码编辑器修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// label1
//
this.label1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.label1.Location = new System.Drawing.Point(5, 7);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(134, 2);
this.label1.TabIndex = 0;
//
// SingleLine
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.label1);
this.Name = "SingleLine";
this.Size = new System.Drawing.Size(144, 16);
this.SizeChanged += new System.EventHandler(this.SingleLine_SizeChanged);
this.ResumeLayout(false);

}

#endregion

private System.Windows.Forms.Label label1;
}
}

[此贴子已经被作者于2006-9-24 16:14:45编辑过]


2006-09-24 16:05
Theron
Rank: 1
等 级:新手上路
帖 子:127
专家分:0
注 册:2006-9-23
收藏
得分:0 
糟糕, 偶又发现一个问题, 就是将含有 我那个自义控件的程序到其它电脑无法运行, 怎么办?!

2006-09-24 16:12
快速回复:自己做的 线控件(SingleLine)
数据加载中...
 
   



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

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