如何实现label的编辑

adaptcw 2007-07-28 09:17:35
我想实现label大小的调整,就是四周出现8个小方块,可以调整大小
各位高手帮帮忙!
...全文
199 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
adaptcw 2007-07-29
  • 打赏
  • 举报
回复
Top
succeeddyf((Abner)山崖里的尘埃)
高手!能稍微解释一下吗?
sadever 2007-07-29
  • 打赏
  • 举报
回复
学习,接分
欧文 2007-07-29
  • 打赏
  • 举报
回复
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Runtime.InteropServices;

namespace WindowsApplication1
{
public partial class Form1 : Form
{
[DllImport("user32.dll", EntryPoint = "GetWindowLong")]
public static extern int GetWindowLong(
int hwnd,
int nIndex
);
[DllImport("user32.dll", EntryPoint = "SetWindowLong")]
public static extern int SetWindowLong(
int hwnd,
int nIndex,
int dwNewLong
);
[DllImport("user32.dll", EntryPoint = "SetWindowPos")]
public static extern int SetWindowPos(
int hwnd,
int hWndInsertAfter,
int x,
int y,
int cx,
int cy,
int wFlags
);
public const int GWL_STYLE = (-16);
public const int WS_THICKFRAME = 0x40000;
const int SWP_NOSIZE = 0x1;
const int SWP_NOMOVE = 0x2;
const int SWP_NOZORDER = 0x4;
const int SWP_FRAMECHANGED = 0x20;

public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
int style = GetWindowLong((int)this.textBox1.Handle, GWL_STYLE);
style |= WS_THICKFRAME;
SetWindowLong((int)this.textBox1.Handle, GWL_STYLE, style);
SetWindowPos((int)this.textBox1.Handle, (int)this.Handle, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOMOVE | SWP_FRAMECHANGED);

}
}
}
RHCL 2007-07-28
  • 打赏
  • 举报
回复
拉到页面点一下或是选中它选择状态栏的"选择标签可以啊~~如果是想实现用户访问让用户自己调的话可以用JS...相关资料请参考51aspx.com

110,552

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧