473,503 Members | 2,159 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Form display problem

I'm working with VB.net and when ever I dynamically create a form when I do
the form.show() or form.visible = true the form.left parameter gets reset to
22. Does anyone have any ideas why this is happening? Below is a copy of
the function:

Private Function Add_Form() As String

Dim FormNew As System.Windows.Forms.Form

Dim LocalMousePosition_Down As Point

Dim LocalMousePosition_Up As Point

'Covert Screen Coordinates To Form Coordinates

LocalMousePosition_Down = _frmHost.PointToClient(_Mouse_Down)

LocalMousePosition_Up = _frmHost.PointToClient(_Mouse_up)

FormNew = New System.Windows.Forms.Form

FormNew.Left = 15

FormNew.Top = 15

FormNew.Size = New System.Drawing.Size(750, 500)

FormNew.Text = "New Form"

FormNew.MdiParent = _frmHost

'_frmHost.Text = "New Form" Don't know why I did this because it changes the
main window

AddHandler FormNew.MouseDown, AddressOf frmGeneric_MouseDown

AddHandler FormNew.MouseUp, AddressOf frmGeneric_MouseUp

'Code to Form Button to Collection

Object_Collection.Add(FormNew)

FormNew.Show()

End Function


Nov 21 '05 #1
3 2826
David,

Have you tried setting the form's StartPosition and Location properties?

Kerry Moorman
"David A. Osborn" wrote:
I'm working with VB.net and when ever I dynamically create a form when I do
the form.show() or form.visible = true the form.left parameter gets reset to
22. Does anyone have any ideas why this is happening? Below is a copy of
the function:

Private Function Add_Form() As String

Dim FormNew As System.Windows.Forms.Form

Dim LocalMousePosition_Down As Point

Dim LocalMousePosition_Up As Point

'Covert Screen Coordinates To Form Coordinates

LocalMousePosition_Down = _frmHost.PointToClient(_Mouse_Down)

LocalMousePosition_Up = _frmHost.PointToClient(_Mouse_up)

FormNew = New System.Windows.Forms.Form

FormNew.Left = 15

FormNew.Top = 15

FormNew.Size = New System.Drawing.Size(750, 500)

FormNew.Text = "New Form"

FormNew.MdiParent = _frmHost

'_frmHost.Text = "New Form" Don't know why I did this because it changes the
main window

AddHandler FormNew.MouseDown, AddressOf frmGeneric_MouseDown

AddHandler FormNew.MouseUp, AddressOf frmGeneric_MouseUp

'Code to Form Button to Collection

Object_Collection.Add(FormNew)

FormNew.Show()

End Function


Nov 21 '05 #2
Are these different from NewForm.Top and NewForm.Left?
"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
David,

Have you tried setting the form's StartPosition and Location properties?

Kerry Moorman
"David A. Osborn" wrote:
I'm working with VB.net and when ever I dynamically create a form when I
do
the form.show() or form.visible = true the form.left parameter gets reset
to
22. Does anyone have any ideas why this is happening? Below is a copy
of
the function:

Private Function Add_Form() As String

Dim FormNew As System.Windows.Forms.Form

Dim LocalMousePosition_Down As Point

Dim LocalMousePosition_Up As Point

'Covert Screen Coordinates To Form Coordinates

LocalMousePosition_Down = _frmHost.PointToClient(_Mouse_Down)

LocalMousePosition_Up = _frmHost.PointToClient(_Mouse_up)

FormNew = New System.Windows.Forms.Form

FormNew.Left = 15

FormNew.Top = 15

FormNew.Size = New System.Drawing.Size(750, 500)

FormNew.Text = "New Form"

FormNew.MdiParent = _frmHost

'_frmHost.Text = "New Form" Don't know why I did this because it changes
the
main window

AddHandler FormNew.MouseDown, AddressOf frmGeneric_MouseDown

AddHandler FormNew.MouseUp, AddressOf frmGeneric_MouseUp

'Code to Form Button to Collection

Object_Collection.Add(FormNew)

FormNew.Show()

End Function



Nov 21 '05 #3
Ok, I got it to work by setting the start position to manual and then
setting the location. I guess I don't understand what the different is
between setting the Form.Top and Form.Left as compared to setting
Form.StartPosition and then Form.Location?

For that matter what's the difference in setting Form.Size as compared to
Form.Width and Form.Lenght?

Thanks for the help!
"David A. Osborn" <do********@hotmail.com> wrote in message
news:uUeAd.274058$V41.202382@attbi_s52...
Are these different from NewForm.Top and NewForm.Left?
"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:32**********************************@microsof t.com...
David,

Have you tried setting the form's StartPosition and Location properties?

Kerry Moorman
"David A. Osborn" wrote:
I'm working with VB.net and when ever I dynamically create a form when I
do
the form.show() or form.visible = true the form.left parameter gets
reset to
22. Does anyone have any ideas why this is happening? Below is a copy
of
the function:

Private Function Add_Form() As String

Dim FormNew As System.Windows.Forms.Form

Dim LocalMousePosition_Down As Point

Dim LocalMousePosition_Up As Point

'Covert Screen Coordinates To Form Coordinates

LocalMousePosition_Down = _frmHost.PointToClient(_Mouse_Down)

LocalMousePosition_Up = _frmHost.PointToClient(_Mouse_up)

FormNew = New System.Windows.Forms.Form

FormNew.Left = 15

FormNew.Top = 15

FormNew.Size = New System.Drawing.Size(750, 500)

FormNew.Text = "New Form"

FormNew.MdiParent = _frmHost

'_frmHost.Text = "New Form" Don't know why I did this because it changes
the
main window

AddHandler FormNew.MouseDown, AddressOf frmGeneric_MouseDown

AddHandler FormNew.MouseUp, AddressOf frmGeneric_MouseUp

'Code to Form Button to Collection

Object_Collection.Add(FormNew)

FormNew.Show()

End Function




Nov 21 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
40624
by: Dan R Brown | last post by:
I have a large form that is generated dynamically in a jsp using xml / xslt. So, to break up this form into several "tabbed" sections, I break up the form using <div> tags. Each <div...
15
6540
by: M Smith | last post by:
I have a form I want to submit to itself. I want to be able to type in a list of numbers and submit the form and have that list show up on the same form under the text box I typed them into and...
3
2213
by: BakelNB | last post by:
I am new to the .Net environment, so please bear with me. I am passing a form object (e.g. formA) to an existing form (e.g. formB) by setting a property value defined in formB to hold the formA...
2
1306
by: Tom Edelbrok | last post by:
I've created a form on the fly at run-time as "new form". Works fine. I even add some controls to it (ie: a label control, etc). I then use "AddOwnedForm" to add my newly created form as an owned...
2
7035
by: assgar | last post by:
Hi Developemnt on win2003 server. Final server will be linux Apache,Mysql and PHP is being used. I use 2 scripts(form and process). The form displays multiple dynamic rows with chechboxs,...
2
1723
by: plumba | last post by:
Ok, another problem... A bit querky this one.. My form calls an onsubmit function to check fields for completion (validation check). Here is a breakdown version of the form: <html>...
7
10222
xNephilimx
by: xNephilimx | last post by:
lHi guys! I'm having a little problem that's getting on my nerves, I couldn't find a solution, I also tryed googling it and I found nothing... (my field of expertise is in AS 2 and 3, but I still...
0
3366
bmallett
by: bmallett | last post by:
First off, i would like to thank everyone for any and all help with this. That being said, I am having a problem retrieving/posting my dynamic form data. I have a form that has multiple options...
7
9333
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
1
3301
by: chromis | last post by:
Hi, I'm having trouble fully implementing the edit section of a contact admin system, so far I have written the following: - Bean (Contact.cfc) - Data Access object (ContactDAO.cfc) - Gateway...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5596
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5023
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4689
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3180
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3170
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1521
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.