?
Solved

Maximize DataGrid With Form

Posted on 2002-05-21
3
Medium Priority
?
608 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses

777 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