473,396 Members | 2,061 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,396 software developers and data experts.

Existential question!

As in "Who am I?" or better "Who am Me?"

When I use:
Dim X0 As Integer = ActiveForm.Location.X

Dim Y0 As Integer = ActiveForm.Location.Y

Dim strTest As String = ActiveForm.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

The strTest variable contains the name of the container form (the
MDIParent). However, when I do this:

Dim X0 As Integer = Me.Location.X

Dim Y0 As Integer = Me.Location.Y

Dim strTest As String = Me.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

I get the name of the form within the container (called FormMain). More
important the locations seem to be all messed up. When I use Me.Location,
the 0,0 point is not the topleft of the form, I have to use the negative
value to try to position some test at the top.

Any advice?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com
Oct 27 '06 #1
7 1090
I forgot to add, my FormMain (dimmed as frmMain) refuses to fill up the
Container i.e. the MDIParent until I switch to another form and then come
back. In the Container form I do have:
Private Sub FormContainer_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

frmMain.MdiParent = Me

frmSliceInfo.MdiParent = Me

frmSliceInfo.Dock = DockStyle.Fill

frmMain.Dock = DockStyle.Fill

frmMain.Show()

End Sub

and I have also set the Dock property in the properties window of all the
forms to "None".
--
Anil Gupte
www.keeninc.net
www.icinema.com

"Anil Gupte" <an*******@icinema.comwrote in message
news:u0****************@TK2MSFTNGP02.phx.gbl...
As in "Who am I?" or better "Who am Me?"

When I use:
Dim X0 As Integer = ActiveForm.Location.X

Dim Y0 As Integer = ActiveForm.Location.Y

Dim strTest As String = ActiveForm.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

The strTest variable contains the name of the container form (the
MDIParent). However, when I do this:

Dim X0 As Integer = Me.Location.X

Dim Y0 As Integer = Me.Location.Y

Dim strTest As String = Me.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

I get the name of the form within the container (called FormMain). More
important the locations seem to be all messed up. When I use Me.Location,
the 0,0 point is not the topleft of the form, I have to use the negative
value to try to position some test at the top.

Any advice?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com


Oct 27 '06 #2
Anil,

Me is the same as in the C languages "this".

It means all the variables (objects values) that are in the object from the
class itself.

me.textBox1 is the same as textbox1.

It is easy however if you don't remember a name to type first me.

It is also easy to tell to another object which object is the sender,

The problem is that you are not telling what kind of form you are using, it
can by instance be a MDI, a showdialog or something used as a usercontrol
inside your control container.

Cor

"Anil Gupte" <an*******@icinema.comschreef in bericht
news:u0****************@TK2MSFTNGP02.phx.gbl...
As in "Who am I?" or better "Who am Me?"

When I use:
Dim X0 As Integer = ActiveForm.Location.X

Dim Y0 As Integer = ActiveForm.Location.Y

Dim strTest As String = ActiveForm.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

The strTest variable contains the name of the container form (the
MDIParent). However, when I do this:

Dim X0 As Integer = Me.Location.X

Dim Y0 As Integer = Me.Location.Y

Dim strTest As String = Me.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

I get the name of the form within the container (called FormMain). More
important the locations seem to be all messed up. When I use Me.Location,
the 0,0 point is not the topleft of the form, I have to use the negative
value to try to position some test at the top.

Any advice?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com


Oct 27 '06 #3
Anil,

I was quick starting, if it is a MDI, you can always find the parent in the
MDI parent property from a child and the childs in the MDIchildren
collection (just looping).

http://msdn2.microsoft.com/en-us/lib...ichildren.aspx

Cor

"Anil Gupte" <an*******@icinema.comschreef in bericht
news:OH****************@TK2MSFTNGP05.phx.gbl...
>I forgot to add, my FormMain (dimmed as frmMain) refuses to fill up the
Container i.e. the MDIParent until I switch to another form and then come
back. In the Container form I do have:
Private Sub FormContainer_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

frmMain.MdiParent = Me

frmSliceInfo.MdiParent = Me

frmSliceInfo.Dock = DockStyle.Fill

frmMain.Dock = DockStyle.Fill

frmMain.Show()

End Sub

and I have also set the Dock property in the properties window of all the
forms to "None".
--
Anil Gupte
www.keeninc.net
www.icinema.com

"Anil Gupte" <an*******@icinema.comwrote in message
news:u0****************@TK2MSFTNGP02.phx.gbl...
>As in "Who am I?" or better "Who am Me?"

When I use:
Dim X0 As Integer = ActiveForm.Location.X

Dim Y0 As Integer = ActiveForm.Location.Y

Dim strTest As String = ActiveForm.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

The strTest variable contains the name of the container form (the
MDIParent). However, when I do this:

Dim X0 As Integer = Me.Location.X

Dim Y0 As Integer = Me.Location.Y

Dim strTest As String = Me.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

I get the name of the form within the container (called FormMain). More
important the locations seem to be all messed up. When I use
Me.Location, the 0,0 point is not the topleft of the form, I have to use
the negative value to try to position some test at the top.

Any advice?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com



Oct 27 '06 #4
I am sorry, I did not understand your response. First of all why does it
(fmrMain) not fill up the container form? The other form (frmSliceInfo)
does, and all the parameters are the same. Also, why is Me not the same as
ActiveForm?

--
Anil Gupte
www.keeninc.net
www.icinema.com

"Cor Ligthert [MVP]" <no************@planet.nlwrote in message
news:%2******************@TK2MSFTNGP05.phx.gbl...
Anil,

I was quick starting, if it is a MDI, you can always find the parent in
the MDI parent property from a child and the childs in the MDIchildren
collection (just looping).

http://msdn2.microsoft.com/en-us/lib...ichildren.aspx

Cor

"Anil Gupte" <an*******@icinema.comschreef in bericht
news:OH****************@TK2MSFTNGP05.phx.gbl...
>>I forgot to add, my FormMain (dimmed as frmMain) refuses to fill up the
Container i.e. the MDIParent until I switch to another form and then come
back. In the Container form I do have:
Private Sub FormContainer_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load

frmMain.MdiParent = Me

frmSliceInfo.MdiParent = Me

frmSliceInfo.Dock = DockStyle.Fill

frmMain.Dock = DockStyle.Fill

frmMain.Show()

End Sub

and I have also set the Dock property in the properties window of all the
forms to "None".
--
Anil Gupte
www.keeninc.net
www.icinema.com

"Anil Gupte" <an*******@icinema.comwrote in message
news:u0****************@TK2MSFTNGP02.phx.gbl...
>>As in "Who am I?" or better "Who am Me?"

When I use:
Dim X0 As Integer = ActiveForm.Location.X

Dim Y0 As Integer = ActiveForm.Location.Y

Dim strTest As String = ActiveForm.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

The strTest variable contains the name of the container form (the
MDIParent). However, when I do this:

Dim X0 As Integer = Me.Location.X

Dim Y0 As Integer = Me.Location.Y

Dim strTest As String = Me.Name

Dim SIX0 = X0 + 560

Dim SIY0 = Y0 - 30

I get the name of the form within the container (called FormMain).
More important the locations seem to be all messed up. When I use
Me.Location, the 0,0 point is not the topleft of the form, I have to use
the negative value to try to position some test at the top.

Any advice?

Thanx,
--
Anil Gupte
www.keeninc.net
www.icinema.com




Oct 27 '06 #5
Thre is one difference: frmMain is shown during the load event of the
mdiform. Try loading frmMain after the mdi form is fully loaded.

Me is the instance you are currently in (if frmMaincode, me means
frmmain, in frmSliceInfo code, me means frmSliceInfo).
ActiveForm is the activeform of the project.

So to see the difference:

'code in frmSliceInfo, which is active
frmMain.mySub 'calls a routine in frmMain
'code in frmMain:
Public Sub mySub()
'When called from above
'Me is frmMain
'ActiveForm is frmSliceInfo

'When called when frmMain is active
'Me is still frmMain
'ActiveForm is now also frmMain
End Sub
Anil Gupte wrote:
I am sorry, I did not understand your response. First of all why does it
(fmrMain) not fill up the container form? The other form (frmSliceInfo)
does, and all the parameters are the same. Also, why is Me not the same as
ActiveForm?
Oct 27 '06 #6
How do I load frmMain after the MDI container is loaded? There is no other
event I can call as far as I know. I may have fixed the problem though by
adding the line:
frmMain.Size = Me.Size

to the Private Sub FormContainer_Load event

Thanx for the input.
--
Anil Gupte
www.keeninc.net
www.icinema.com
"Theo Verweij" <tv******@xs4all.nlwrote in message
news:OR****************@TK2MSFTNGP02.phx.gbl...
Thre is one difference: frmMain is shown during the load event of the
mdiform. Try loading frmMain after the mdi form is fully loaded.

Me is the instance you are currently in (if frmMaincode, me means frmmain,
in frmSliceInfo code, me means frmSliceInfo).
ActiveForm is the activeform of the project.

So to see the difference:

'code in frmSliceInfo, which is active
frmMain.mySub 'calls a routine in frmMain
'code in frmMain:
Public Sub mySub()
'When called from above
'Me is frmMain
'ActiveForm is frmSliceInfo

'When called when frmMain is active
'Me is still frmMain
'ActiveForm is now also frmMain
End Sub
Anil Gupte wrote:
>I am sorry, I did not understand your response. First of all why does it
(fmrMain) not fill up the container form? The other form (frmSliceInfo)
does, and all the parameters are the same. Also, why is Me not the same
as ActiveForm?

Oct 27 '06 #7
Or use frmMain.windowstate = FormWindowState.Maximized instead of the
dock property - It seems this is what you want after all.

Anil Gupte wrote:
How do I load frmMain after the MDI container is loaded? There is no other
event I can call as far as I know. I may have fixed the problem though by
adding the line:
frmMain.Size = Me.Size

to the Private Sub FormContainer_Load event

Thanx for the input.
Oct 27 '06 #8

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

Similar topics

72
by: Raymond Hettinger | last post by:
Peter Norvig's creative thinking triggered renewed interest in PEP 289. That led to a number of contributors helping to re-work the pep details into a form that has been well received on the...
3
by: Stevey | last post by:
I have the following XML file... <?xml version="1.0"?> <animals> <animal> <name>Tiger</name> <questions> <question index="0">true</question> <question index="1">true</question> </questions>
7
by: nospam | last post by:
Ok, 3rd or is it the 4th time I have asked this question on Partial Types, so, since it seems to me that Partial Types is still in the design or development stages at Microsoft, I am going to ask...
3
by: Ekqvist Marko | last post by:
Hi, I have one Access database table including questions and answers. Now I need to give answer id automatically to questionID column. But I don't know how it is best (fastest) to do? table...
10
by: glenn | last post by:
I am use to programming in php and the way session and post vars are past from fields on one page through to the post page automatically where I can get to their values easily to write to a...
10
by: Rider | last post by:
Hi, simple(?) question about asp.net configuration.. I've installed ASP.NET 2.0 QuickStart Sample successfully. But, When I'm first start application the follow message shown. ========= Server...
53
by: Jeff | last post by:
In the function below, can size ever be 0 (zero)? char *clc_strdup(const char * CLC_RESTRICT s) { size_t size; char *p; clc_assert_not_null(clc_strdup, s); size = strlen(s) + 1;
56
by: spibou | last post by:
In the statement "a *= expression" is expression assumed to be parenthesized ? For example if I write "a *= b+c" is this the same as "a = a * (b+c)" or "a = a * b+c" ?
2
by: Allan Ebdrup | last post by:
Hi, I'm trying to render a Matrix question in my ASP.Net 2.0 page, A matrix question is a question where you have several options that can all be rated according to several possible ratings (from...
3
by: Zhang Weiwu | last post by:
Hello! I wrote this: ..required-question p:after { content: "*"; } Corresponding HTML: <div class="required-question"><p>Question Text</p><input /></div> <div...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.