Solved

Function: SetBounds

Posted on 2004-10-07
4
247 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
This video discusses moving either the default database or any database to a new volume.
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

20 Experts available now in Live!

Get 1:1 Help Now