473,734 Members | 2,511 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Why isn't form centering in parent?

I have the StartPosition property set to CenterParent for
GarXfaceUI.Tran sferStatus.

The button below is on another form. Why isn't
GarXfaceUI.Tran sferStatus being centered in the parent?
Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck
Private frmTransfer As New GarXfaceUI.Tran sferStatus
frmTransfer.Sho w(Me)

End Sub


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Jan 2 '07 #1
5 1586
Bruce,
The button below is on another form. Why isn't GarXfaceUI.Tran sferStatus
being centered in the parent?
Because that you only call a method which does nothing.

Cor

"Bruce" <Br***@nospam.c omschreef in bericht
news:OT******** ******@TK2MSFTN GP04.phx.gbl...
>I have the StartPosition property set to CenterParent for
GarXfaceUI.Tra nsferStatus.

The button below is on another form. Why isn't GarXfaceUI.Tran sferStatus
being centered in the parent?
Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck
Private frmTransfer As New GarXfaceUI.Tran sferStatus
frmTransfer.Sho w(Me)

End Sub


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Jan 2 '07 #2
"Bruce" <Br***@nospam.c omschrieb:
Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck
Private frmTransfer As New GarXfaceUI.Tran sferStatus
frmTransfer.Sho w(Me)

End Sub
Your code does not compile because 'Private' cannot be used inside a method.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Jan 2 '07 #3
Herfried K. Wagner [MVP] wrote:
>
Your code does not compile because 'Private' cannot be used inside a
method.

It is actually global

Private frmTransfer As New GarXfaceUI.Tran sferStatus

Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck

frmTransfer.Sho w(Me)

End Sub

I just pasted in in for ease of viewing the code. The code compiles and
runs the second dialog just does not center on the parent.

RxWaypoints_Cli ck is a button on one form that shows a second form
(dialog box).

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Jan 3 '07 #4
Cor Ligthert [MVP] wrote:
Bruce,
>The button below is on another form. Why isn't GarXfaceUI.Tran sferStatus
being centered in the parent?

Because that you only call a method which does nothing.

Cor

"Bruce" <Br***@nospam.c omschreef in bericht
news:OT******** ******@TK2MSFTN GP04.phx.gbl...
>I have the StartPosition property set to CenterParent for
GarXfaceUI.Tra nsferStatus.

The button below is on another form. Why isn't GarXfaceUI.Tran sferStatus
being centered in the parent?
Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck
Private frmTransfer As New GarXfaceUI.Tran sferStatus
frmTransfer.Sho w(Me)

End Sub


--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

It is actually global

Private frmTransfer As New GarXfaceUI.Tran sferStatus

Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck

frmTransfer.Sho w(Me)

End Sub

I just pasted in in for ease of viewing the code. The code compiles and
runs the second dialog just does not center on the parent.
--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com
Jan 3 '07 #5
For some reason or another the CenterParent value for the Form.StartPosit ion
property is only honoured if a form is shown using the ShowDialog method.

When the show method is used and the StartPosition property is set to
CenterParent then the behaviour is the same as if was set to
WindowsDefaultL ocation.

Passing a 'parent' to the method has no effect on this. The 'parent'
paramter is used where you want the form to be 'parented' to yet another
form.

Say you have a Form (form1) from which you have 'shown' a another Form
(form2). You also have another Form (form3) that you 'show' from form1 but
want it 'parented' to form2. To do this you execute the statement (in
form1):

form3.Show(form 2)
"Bruce" <Br***@nospam.c omwrote in message
news:um******** *****@TK2MSFTNG P04.phx.gbl...
Herfried K. Wagner [MVP] wrote:
>>
Your code does not compile because 'Private' cannot be used inside a
method.


It is actually global

Private frmTransfer As New GarXfaceUI.Tran sferStatus

Private Sub RxWaypoints_Cli ck(ByVal eventSender As System.Object, ByVal
eventArgs As System.EventArg s) Handles RxWaypoints.Cli ck

frmTransfer.Sho w(Me)

End Sub

I just pasted in in for ease of viewing the code. The code compiles and
runs the second dialog just does not center on the parent.

RxWaypoints_Cli ck is a button on one form that shows a second form (dialog
box).

--
Bruce E. Stemplewski
GarXface OCX and C++ Class Library for the Garmin GPS
www.stempsoft.com

Jan 3 '07 #6

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

Similar topics

3
4799
by: Chris | last post by:
Hi, I am pretty new to CSS authoring and find myself in a tricky situation. I have a series of divs (dynamically generated - there could be up to 8) as follows: <div class="person"> <h2>Name</h2> <img src="images/name.gif" alt="Chris" /> <p>Message Here</p>
3
4634
by: CMAR | last post by:
To center my <div>, I am currently using something like <div id="navcontainer" align="center"> This centers fine, but is deprecated code. I have seen these two solutions recommended. 1) body { text-align: center; min-width: 500px;
2
6159
by: Robert W. | last post by:
In my WinForms application, I have a main form, which may or may not be visible depending on the user's wishes. This main form initiates a separate thread that starts a data transfer process. In this thread I want to show a special dialog box. Because the question must be answered, I'm using ShowDialog to display it. Just before doing so, I have some simple code to: - Center it in the main form, if that form is visible - Center it in...
7
4633
by: Peter | last post by:
I have a primary form named frmMain. During some extended data pulls I launch another Dialog Form named frmUpdating. How do I keep the frmUpdating centered on the frmMain if a user moves the frmMain form? -Peter
3
4736
by: Zack Sessions | last post by:
I am using VB.NET 2003. I have read the threads concerning the problem where the FormStartPosition of CenterParent is ignored if the form is displayed with the Show method as opposed to the ShowDialog method. I am having a similar problem and I found a thread that had the following code in the child form's Load event: Me.Location = New Point(( _ Me.MdiParent.ClientSize.Width - Me.Width) * 0.5,
3
2742
by: wmasterj | last post by:
I have a div i want it to be max a certain width - thats done already But - i want the empty sides of the div to have the same width - like with frames (cols="*,800, *") So no matter how much i resize the window, the div stays in the middle. I should know this from before but i'm just blacking out and need some help. the page in doing it on is: http://dinpc.no-ip.com:83/portal/jeroen
3
4209
by: John Pote | last post by:
1. Horizontal centering a <divin browser window. The current trend seems to be to place page content in a fixed width area in the middle of the browser window. How is this achieved? If I use a top level <divthen I can place it with CSS attribute 'left:', but this is a fixed offset. Is it possible to have a <divcentered in the browser window? 2. Verticle centering in <div>
5
4824
by: Markus Ernst | last post by:
Hello This is a test example: http://www.markusernst.ch/anthracite/ http://www.markusernst.ch/anthracite/living_divani.html After googling and experimenting for several hours, I ended up doing this demo with tables. The main problems are the vertical centering of the info area, and of the text inside the squares.
2
3062
by: rudicheow | last post by:
SHORT VERSION ============= I have a bunch of identical fixed-size single-celled tables that rest against each other horizontally thanks to "float:left". These tables are dynamically generated and the number of them can vary greatly. They are all contained within a parent table cell, which is centred on the page. But I am unable to find a way of centering these table cells within the parent cell.
0
8946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9449
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9310
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9236
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6735
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6031
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4550
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2724
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2180
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.