[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Maximize DataGrid With Form

Posted on 2002-05-21
3
Medium Priority
?
609 Views
Last Modified: 2008-02-26
I'm using VB6 against an SQL Server database.

From the main application screen a form is launched which has a DataGrid on the form.
It's a Sheridan datagrid but has many of the same properties as a Microsoft datagrid.
The user can maximize the form but the datagrid doesn't resize along with the form.
Is there a way I can resize my datagrid when the user maximizes the form?
And if so, which event would this code be placed into?

Thanks in Advance.
John
0
Comment
Question by:jtrapat1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7024128
Private Sub Form_Resize()
  On Error Resume Next
  DataGrid1.Height = Me.Height
  DataGrid1.Width = Me.Width
End Sub

Or adjust the height/width/top/left to correctly size within the form.

You need the on error as if the form is minimized or resized too small you may generate an error because the datagrid height or width may go less than zero.
0
 
LVL 2

Expert Comment

by:Ixeus
ID: 7024140
Private Sub Form_Resize()

    On Error Goto 0

    grd.top = coords here
    grd.left = coords here
    grd.height = me.scaleHeight - grd.left
    grd.width = me.scaleWidth - grd.top
       
   
End Sub


something like that, don't have VB on this comp now, just a guide I hope it works for you =)
0
 
LVL 2

Expert Comment

by:Ixeus
ID: 7024143
on error resume next not 0 sorry
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses

656 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