473,320 Members | 1,950 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

how to dynamically position form inside MDI form?

Greetings.

I have a child form inside an MID parent form. The child form is wider than
the MID parent form. The child form contains a number of textboxes which
are positioned from left to right on the child form where the textbox on the
right is not viewable because it extends beyond the right border of the MDI
parent form. What I need to happen is when I tab through the textboxes -
when I tab into the textbox on the right side of the chld form - the textbox
which is not viewable - I want to bring that textbox into view by
repositioning the child form within the MDI parent form - the same as if I
were to manually scroll the MDI parent form to view the textbox on the right
side of the child form. But I need this to happen dynamically.

Could someone suggest how this could be accomplished? Is there a Move
command for repositioning the child form within the MID parent?

Thanks,
Rich
May 22 '06 #1
2 4265
Well, I tried getting the location of the child form by
Console.Writeline(Me.Location.X.ToString + " " + Me.Location.Y.ToString)
when I enter the textbox which I scroll to the right to reach. Then I add
these values to the Offset property of Me.Location.

Private Sub txt3_Enter(...) Handles txt3.Enter
Console.WriteLine(Me.Location.X.ToString & " " & Me.Location.Y.ToString)
Me.Location.Offset(-304, 0)
Console.WriteLine(Me.Location.X.ToString & " " & Me.Location.Y.ToString)
End Sub

I got 0, 0 before the Offset and 0, 0 after the Offset. If I manually
scroll the child form over to the right then I get -304, 0 for Me.Location.

How can I make the form move dynamically to that location?


"Rich" wrote:
Greetings.

I have a child form inside an MID parent form. The child form is wider than
the MID parent form. The child form contains a number of textboxes which
are positioned from left to right on the child form where the textbox on the
right is not viewable because it extends beyond the right border of the MDI
parent form. What I need to happen is when I tab through the textboxes -
when I tab into the textbox on the right side of the chld form - the textbox
which is not viewable - I want to bring that textbox into view by
repositioning the child form within the MDI parent form - the same as if I
were to manually scroll the MDI parent form to view the textbox on the right
side of the child form. But I need this to happen dynamically.

Could someone suggest how this could be accomplished? Is there a Move
command for repositioning the child form within the MID parent?

Thanks,
Rich

May 22 '06 #2
OK. Here is something else I tried that sort of did work:

Private sub txt3_Enter(...)
Dim p As New Point
p.X = -300
p.Y = 0
Me.Location = p
End Sub.

Now the form did move.
"Rich" wrote:
Well, I tried getting the location of the child form by
Console.Writeline(Me.Location.X.ToString + " " + Me.Location.Y.ToString)
when I enter the textbox which I scroll to the right to reach. Then I add
these values to the Offset property of Me.Location.

Private Sub txt3_Enter(...) Handles txt3.Enter
Console.WriteLine(Me.Location.X.ToString & " " & Me.Location.Y.ToString)
Me.Location.Offset(-304, 0)
Console.WriteLine(Me.Location.X.ToString & " " & Me.Location.Y.ToString)
End Sub

I got 0, 0 before the Offset and 0, 0 after the Offset. If I manually
scroll the child form over to the right then I get -304, 0 for Me.Location.

How can I make the form move dynamically to that location?


"Rich" wrote:
Greetings.

I have a child form inside an MID parent form. The child form is wider than
the MID parent form. The child form contains a number of textboxes which
are positioned from left to right on the child form where the textbox on the
right is not viewable because it extends beyond the right border of the MDI
parent form. What I need to happen is when I tab through the textboxes -
when I tab into the textbox on the right side of the chld form - the textbox
which is not viewable - I want to bring that textbox into view by
repositioning the child form within the MDI parent form - the same as if I
were to manually scroll the MDI parent form to view the textbox on the right
side of the child form. But I need this to happen dynamically.

Could someone suggest how this could be accomplished? Is there a Move
command for repositioning the child form within the MID parent?

Thanks,
Rich

May 22 '06 #3

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

Similar topics

1
by: Randell D. | last post by:
HELP! I am determined to stick with this... I'm getting there... for those who haven't read my earlier posts, I'm createing what should be a simple function that I can call to check that...
39
by: Randell D. | last post by:
Folks, I'm sure this can be done legally, and not thru tricks of the trade - I hope someone can help. I'm writing a 'tool' (a function) which can be used generically in any of my projects. ...
4
by: Stu | last post by:
Hi, I am writing a content management system that has to have W3C compliant output. The pages are template driven and there are special strings within the template to be used as placeholders for...
4
by: Kevin Blount | last post by:
bit long winded this one, so stick with me: I'm trying to create a form that can go to one of 3 places, depending on various elements. My form control looks like this: <form runat="server"...
7
by: Ron Goral | last post by:
Hello I am new to creating objects in javascript, so please no flames about my coding style. =) I am trying to create an object that will represent a "div" element as a menu. I have written...
8
by: BillE | last post by:
When I create a control dynamically and it grows according to the content, the control Height property still returns the original default control height instead of the height after expanding. ...
1
by: semomaniz | last post by:
I have a form where i have created the form dynamically. First i manually added a panel control to the web page. Then i added another panel dynamically and inside this panel i created tables. I have...
1
by: =?Utf-8?B?c3RldmVuIHNjYWlmZQ==?= | last post by:
Hi I have been banging my head for a few days now with this issue. I have a page that has several update panels everything is working fine except for 1 thing. I am creating a sort of wizard...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.