且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在运行时在VB中移动控件并保存位置数据?

更新时间:2023-12-06 14:57:22

例如:

创建新设置:项目菜单->属性->设置->创建如下设置

Create a New Setting: Project menu-> Properties -> Settings ->create a setting as below

Name         Type               Scope      Value
myLoc   System.Drawing.Point    User       2;2

应用于应用

在Form_Load时读取设置

Read Settings when Form_Load

Button1.Location = My.Settings.myLoc

更改并保存设置

My.Settings.myLoc = Button1.Location
My.Settings.Save()