Solved

Function: SetBounds

Posted on 2004-10-07
4
249 Views
Last Modified: 2008-02-01
Hello

I am having a problem with the following function call:

     m_oForm.SetBounds(0, 0, fmdi.ClientRectangle.Width, fmdi.ClientRectangle.Height)

Before execution of the above function, Form fmdi does not have
scroll bars. After exectuion Scrollbars appear on Form fmdi.

any idea what I am doing wrong ???
0
Comment
Question by:mat0974
  • 3
4 Comments
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12249727
Hi mat0974,

what are you trying to achieve, are you trying to fill a mdi child in the parent without maximizing ?
0
 
LVL 25

Expert Comment

by:RonaldBiemans
ID: 12249854
if you are use this

Private Sub FillActiveChildFormToClient()
 
               Dim child As Form = Me.ActiveMdiChild
 
               Dim mdiClientArea As Rectangle = Rectangle.Empty
 
               Dim c As Control
 
               For Each c In Me.Controls
 
                    If TypeOf c Is MdiClient Then
 
                         mdiClientArea = c.ClientRectangle
 
                    End If
 
               Next
 
               child.Bounds = mdiClientArea
 
          End Sub
 
0
 

Author Comment

by:mat0974
ID: 12249945
I want to stretch form m_oForm to fit in the Client area of Form
fmdi. I do not want to see scroll bars on form fmdi.

(I am migrating a VB6 Application to VBNET. In VB6 the function
used was Form.move())
0
 
LVL 25

Accepted Solution

by:
RonaldBiemans earned 125 total points
ID: 12250011
Then use the code I posted. This will not produce the scrollbars
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now