将表单放置在辅助屏幕上,并将结构传递给其他表单 [英] Form placement on Secondary screen and passing structure to the other form

查看:79
本文介绍了将表单放置在辅助屏幕上,并将结构传递给其他表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

该代码可以在第二个屏幕上正确显示我的表单,但是我有三个问题
1.如何在屏幕上找到表格(即居中,位于200,200或其他位置)
2.在单屏PC上运行时,如何确保它能正常工作?
3.我需要传递一个结构(将单个记录传递给第二种形式).我有一个25,000条记录的数据库,当这些用户之一试图在新数据库中注册时,需要在第二种形式上显示其信息以进行注册.

感谢您的帮助
杰克

The code correctly displays my form on the second screen but I have three questions
1. How do I locate the form on the screen (ie centered, at 200,200, or other locations)
2. How do I ensure it will work when run on a PC with a single screen?
3. I need to pass a structure (single record to the second form). I have a db of 25,000 records and when one of those users is trying to register in the new db their information needs to be displayed on the second form for their registration.

Thanks for any help
Jack

Structure User
    Dim First As String
    Dim Middle As String
    Dim Last As String
    Dim Addr1 As String
    Dim Addr2 As String
    Dim City As String
    Dim State As String
End Structure

Dim My_Users(25000) As User

Private Sub Legacy_User_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Legacy_User.Click
        Dim form As New Legacy_Screen()
        Dim screen As Screen
        ' Display a form on second screen (0, 1)
        screen = screen.AllScreens(1)
        ' Set the StartPosition to Manual otherwise the system will assign an automatic start 
        form.StartPosition = FormStartPosition.Manual
        form.Location = screen.Bounds.Location
        ' Show the form
        form.ShowDialog(Me)
    End Sub

推荐答案

首先,您必须确定第二个监视器是否甚至已连接到系统,如果是,则将其与主监视器相关联.完成此操作后,您可以轻松更改第二个表单的位置,使其显示在第二个监视器上.

您无需将所有25,000个用户传递给表2-只需做某事即可.对吧?

返回我对先前问题的回答以获取有关此操作的说明.

至于确定有多少显示器连接到系统及其相对位置,google是您的朋友.
First, you have to determine if a 2nd monitor is even attached to the system, and if so, WHERE it is in relation to the primary monitor. Once you''ve done that, you can easily change the location of the 2nd form so that it appears on the 2nd monitor.

You do NOT need to pass all 25,000 users to form 2 - just the one that''s doing something. Right?

Go back to my answer to your previous question for instructions for this.

As far as determining how many monitors are attached to the system and their relative locations, google is your friend.


John

首先,您必须确定第二个监视器是否甚至已连接到系统,如果是,则将它与主监视器相关联.一旦完成此操作,就可以轻松更改第二个窗体的位置,以便它出现在第二台监视器上."

哇,我没想到吗?而且由于我说过代码正在第二个屏幕上显示,所以我想知道发布之前您阅读了多少书?

您不需要将所有25,000个用户传递给第2个表单-只需做某事就可以.对吧?"

您现在非常敏锐地看了看我的两个帖子,几乎知道我在问什么?

尝试阅读上面的#3!希望您在发布之前先阅读所有内容.

返回我对先前问题的回答以获取有关此操作的说明."

约翰就走了!!!

您的回答表明您对我的问题不感兴趣,而对帮助的兴趣减少了-您只是想垫上自我!我说过,如果我知道我不会问这个问题的答案,您的回答显然是泥泞.

这是为了你的自我.

好吧,伙计,您对VB的了解比我还多,自从我三周前开始第一个VB项目以来,这真是令人印象深刻.我不是用C语言编写的VB程序员!

我编写的代码比您使用的更多,但是我是VB的新手.当有人知道一些事情并且可以解释它时,我印象深刻,显然您是我可怜的一个拥有如此自我和很少才华支持的人!

再见

不要打扰,我宁愿没有回应,也不必再次看到您的名字!
John

"First, you have to determine if a 2nd monitor is even attached to the system, and if so, WHERE it is in relation to the primary monitor. Once youve done that, you can easily change the location of the 2nd form so that it appears on the 2nd monitor."

Wow I could never think of that? And since I stated that the code is displaying on the second screen I wonder exactly how much you read before posting?

"You do NOT need to pass all 25,000 users to form 2 - just the one that doing something. Right?"

Very perseptive you now have subposedly looked at two of my posts and almost know what I am asking?

TRY reading #3 above! I wish you would read alittle before posting.

"Go back to my answer to your previous question for instructions for this."

John JUST GO AWAY!!!

Your responses show your lack of interest in my question and less interest in helping--you simply want to pad your ego! I stated your response was clear as mud if I knew the answer I wouldnt ask the question.

Here is for your ego.

Well ladi dah you know more VB than I do, that is SOOOO impressive since I started my first VB project 3 weeks ago. I am NOT a VB programmer I write in C!

I have written more code than you have used, but I am a newbie in VB. I am impressed when someone knows something and can explain it you obviously are someone I look at with pity to have such an ego and so little talent to back it!

Bye

Don''t bother to respond I would rather get no response than to have to see your name again!


为需要答案的其他人

http://msdn.microsoft.com/zh-cn/magazine/cc164124.aspx
for others needing the answer

http://msdn.microsoft.com/en-us/magazine/cc164124.aspx


这篇关于将表单放置在辅助屏幕上,并将结构传递给其他表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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