我的窗口为什么不是正方形的??? ClientSize是指工作区的大小。你用Size就对了。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 using System;using System.Drawing;using System.Collections;using System.ComponentModel;using System.Windows.Forms;using System.Data;namespace BMT{ /// <summary> /// Summary description for Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { /// <summary> /// Required designer variable. /// </summary> private System.ComponentModel.Container components = null; public Form1() { // // Required for Windows Form Designer support // InitializeComponent(); // // TODO: 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() { // // Form1 // this.AllowDrop = true; this.AutoScaleBaseSize = new System.Drawing.Size(6, 14); this.ClientSize = new System.Drawing.Size(32, 32); this.ControlBox = false; this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None; this.Location = new System.Drawing.Point(5, 5); this.Name = "Form1"; this.ShowInTaskbar = false; this.StartPosition = System.Windows.Forms.FormStartPosition.Manual; this.TopMost = true; this.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver); this.Deactivate += new System.EventHandler(this.Form1_Deactivate); } #endregion /// <summary> /// The main entry point for the application. /// </summary> [STAThread] static void Main() { Application.Run(new Form1()); } private void Form1_DragOver(object sender, System.Windows.Forms.DragEventArgs e) { MessageBox.Show((string)e.Data.GetData(DataFormats.StringFormat,true)); } private void Form1_Deactivate(object sender, System.EventArgs e) { this.BringToFront(); } }}这个,就是我代码。依然不是正方形的。郁闷。 this.ClientSize = new System.Drawing.Size(32, 32);更改为this.Size = new System.Drawing.Size(32, 32);依然。 C#SQL的问题 关于socket的一个小疑问 一个初学c#者的疑惑 关于反序列化---〉取出数据库里保存的序列化的Class,为什么反序列就不行?? SqlDataAdapter的Update 方法后自动调用DataTable.AcceptChanges方法,有什么办法可以让他不自动调用吗?急求! 如何利用TreeView動態生成樹狀結構?高分求教! 高分求救-关于EXCEL表格格式问题 上网1小时=1美金?! 关于C#, C++ and VB.NET 简单问题,C#注册表编程! 有人能告诉我吗?怎么做个浏览器 关于线程的问题,谢谢了。
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;namespace BMT
{
/// <summary>
/// Summary description for Form1.
/// </summary>
public class Form1 : System.Windows.Forms.Form
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null; public Form1()
{
//
// Required for Windows Form Designer support
//
InitializeComponent(); //
// TODO: 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()
{
//
// Form1
//
this.AllowDrop = true;
this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
this.ClientSize = new System.Drawing.Size(32, 32);
this.ControlBox = false;
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;
this.Location = new System.Drawing.Point(5, 5);
this.Name = "Form1";
this.ShowInTaskbar = false;
this.StartPosition = System.Windows.Forms.FormStartPosition.Manual;
this.TopMost = true;
this.DragOver += new System.Windows.Forms.DragEventHandler(this.Form1_DragOver);
this.Deactivate += new System.EventHandler(this.Form1_Deactivate); }
#endregion /// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.Run(new Form1());
} private void Form1_DragOver(object sender, System.Windows.Forms.DragEventArgs e)
{
MessageBox.Show((string)e.Data.GetData(DataFormats.StringFormat,true));
} private void Form1_Deactivate(object sender, System.EventArgs e)
{
this.BringToFront();
}
}
}这个,就是我代码。依然不是正方形的。郁闷。
更改为
this.Size = new System.Drawing.Size(32, 32);
依然。