如何在VB中将表单定位为屏幕的顶部中心 [英] How do I position a form to be top centre of the screen in VB

查看:37
本文介绍了如何在VB中将表单定位为屏幕的顶部中心的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想要一个工具栏样式的应用程序,它将位于屏幕的顶部 - 中间,但不确定使用什么代码来自动执行此操作.

I want to have a toolbar style application that will sit at the top of the screen - in the middle but unsure on what code to use to make this happen automatically.

没有客户定位选项 - 就像在旧的 VB 时代一样.有人可以帮我吗?

There is no customer position option - like there was back in the old VB days. Can anybody help me?

推荐答案

在 Form_Load 中添加:

Add this in Form_Load:

Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
    CenterToScreen()
    Top = 0
End Sub

这篇关于如何在VB中将表单定位为屏幕的顶部中心的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆