Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




How To Control Size Of Datagrid?


Hi All,

I am using a VB6 datagrid to display records. I found the last column's width in the datagrid changes in different OS. I am trying to hard code the column's width like this:

datagrid1.columns(1).width = datagrid1.width - datagrid1.columns(0)

However, I have to minus the width of the record selector, too. Anyone knows how to get or set the record selector's width?

Jeff




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
DataGrid Size
Hello!

Does somebody have any idea about how can I make a DataGrid to have same hight like how many rows has? I want to eliminate the space between the last row and the botom of grid.My grid may has until 19 rows (max).

With many thanks, Zane

Datagrid Row Size Problem
Hi guys,

I have a datagrid with 3 columns.

1. Symptom
2. Cause
3. Remedy

1.The user enters the symptom which is usually a very short sentence. For ex, Pump not working.

2. The cause is usually a little longer.

No power to the pump. unit unplugged, etc.

3. Here's the problem. The remedy is about 10 times longer than the other 2 columns.

I set the datagrid properties so that it has wordwrap. So everything I type in is put into the datagrid but I can't see it unless i use the arrow keys.

Is there a way to get a scrollbar on a datagrid cell? Or is there a way to code the datagrid so that the rowheight will be determined by the amount of words typed into it.

What I'm trying to do here is just be able to view everything in one row of the datagrid without having to use the arrow keys.

Thanks.

Resize Form To Datagrid Size
I have a form with only a datagrid on it. I want the form to resize (on form_load) to the datagrid's size (according to how many rows it retrieves). Can someone help me?

Setting The Size Of Fields In The Datagrid
How can i set the size of the fields in a datagrid ? I have fields like 'product description' up to 300 caracters and 'values' that can't be bigger than 10 or 12 digits

Increase Size Of Contents In Datagrid [VB6]
I have been receiving complaints regarding the size of characters in my Datagrid, supposedly it is written to small for people to read comfortably.

So I have been requested to increase the Font Size of the information displayed in my Datagrid, logically I assumed that changing the “Font Size” property of the Datagrid itself would solve the problem however no changes occurred when modifiying the font size from 9 to 12.

Therefore there must be another correct way to accomplish this, maybe it has to do with the Datasource being bound programmatically (via code).

Any clues?

DataGrid Cell Forecolor And TextBox Min Size
Hello,
I have two questions that are driving me mad:
1) Do you know if is there a way to set in a DataGrid control the forecolor of the only current cell? (I saw that in the MSHFlexGrid it is possible to do it by means of CellForeColor property, but I can't use that control because I need to modify the access database)
2) Using a TextBox, I noticed that it isn't possible to reduce its height under a minimum size (280 twips approximately). Is there a way to reduce this minimum size?

Thank you wery much

Size Column In Datagrid By Code (SOLVED)
Hello,

In my app. I use this code to size my columns:

Me.Datagrid.Columns(2).Width = 2500

Now, the forms that are finished are having no problems, and it works perfect BUT any form I create from now on, this code doens't work..

very strange I think!

What could be the problem ?

tnx in advance....

nickname


!! The code to size the columns may not be followed by a refresh... !!

How To Resize Columns In A DataGrid Dynamicly With The Size Of The Text
I was woundering if there is a way to resize the columns of a DataGrid dynamicly with the size of the text in them at run time.
I looked around on the the net and in my books and I do not see anything. Can someone tell me if and how this can be done.
Thank you

Refresh DataGrid(Microsoft DataGrid Control 6.0)
Hi,

I am having a problem refreshing the datagrid in the following scenario:

I have Form1 with ADODC control and DataGrid(Microsoft DataGrid Control 6.0). The grid (is used to display employee records) contains 5 columns (for example Office telephone number) . On clicking of a row on the grid the details window opens up. This window is used to update the employee information. On saving the employee record if Office telephone number is changed then the datagrid should be refreshed with latest data of the record. The refresh is done using the following command:
msgbox "activate"
adodcobject.refresh
datagridobject.refresh.

If the message box is commented then the refresh statements do not get executed. I need a solution for that.

Regards,
Rashmi.

Finding The Size Of The Contents Of An Image Control Or A PictureBox Control
How does one find that? Once the user selects an Image to be displayed, I want to know the size of that image. Is it possible to detect the size of the image? It sure must be stored somewhere, right? Similar threads I have seen all point to BitBlt and other Bitmap API and they are way over my head!

To be precise, I want to copy an image to a byte array, but I am stumped when it comes to re-dimensioning the array. This is for a Winsock application. Currently I am writing the image to a temp disk file and reading it back into a Byte Array. I want to avoid that

Thanx for you help in advance

How Do I Get This Information Into A Datagrid Control (datagrid)???
I have this information that i want to call out of a file and put into a data grid.
"AL","Alabama"
"AK","Alaska"
"AS","American Samoa"
"AZ","Arizona"
"AR","Arkanzas"
"CA","California"
"CZ","Canal Zone"
"CO","Colorado"
"CT","Connecticut"
"DE","Deleware"
"DC","District of Columbia"
"FL","Florida"
"GA","Georgia"
"GU","Guam"
"HI","Hawaii"
"ID","Idaho"
"IL","Illinois"
"IN","Indiana"
"IA","Iowa"
"KS","Kansas"
"KY","Kentucky"
"LA","Louisiana"
"ME","Maine"
"MD","Maryland"
"MA","Massachusetts"
"MI","Michigan"
"MN","Minnesota"
"MS","Mississippi"
"MO","Missouri"
"MT","Montana"
"NE","Nebraska"
"NV","Nevada"
"NH","New Hampshire"
"NJ","New Jersey"
"NM","New Mexico"
"NY","New York"
"NC","North Carolina"
"ND","North Dakota"
"OH","Ohio"
"OK","Oklahoma"
"OR","Oregon"
"PA","Pennsylvania"
"PR","Puerto Rico"
"RI","Rhode Island"
"SC","South Carolina"
"SD","South Dakota"
"TN","Tennessee"
"TX","Texas"
"TT","Trust Territories"
"UT","Utah"
"VT","Vermont"
"VA","Virginia"
"VI","Virgin Islands"
"WA","Washington"
"WV","West Virginia"
"WI","Wisconsin"
"WY","Wyoming"

And i want to get it into a data grid.
How do i do this??????

How Do I Get This Information Into A Datagrid Control (datagrid)???
I have this information that i want to call out of a file and put into a data grid.
"AL","Alabama"
"AK","Alaska"
"AS","American Samoa"
"AZ","Arizona"
"AR","Arkanzas"
"CA","California"
"CZ","Canal Zone"
"CO","Colorado"
"CT","Connecticut"
"DE","Deleware"
"DC","District of Columbia"
"FL","Florida"
"GA","Georgia"
"GU","Guam"
"HI","Hawaii"
"ID","Idaho"
"IL","Illinois"
"IN","Indiana"
"IA","Iowa"
"KS","Kansas"
"KY","Kentucky"
"LA","Louisiana"
"ME","Maine"
"MD","Maryland"
"MA","Massachusetts"
"MI","Michigan"
"MN","Minnesota"
"MS","Mississippi"
"MO","Missouri"
"MT","Montana"
"NE","Nebraska"
"NV","Nevada"
"NH","New Hampshire"
"NJ","New Jersey"
"NM","New Mexico"
"NY","New York"
"NC","North Carolina"
"ND","North Dakota"
"OH","Ohio"
"OK","Oklahoma"
"OR","Oregon"
"PA","Pennsylvania"
"PR","Puerto Rico"
"RI","Rhode Island"
"SC","South Carolina"
"SD","South Dakota"
"TN","Tennessee"
"TX","Texas"
"TT","Trust Territories"
"UT","Utah"
"VT","Vermont"
"VA","Virginia"
"VI","Virgin Islands"
"WA","Washington"
"WV","West Virginia"
"WI","Wisconsin"
"WY","Wyoming"

And i want to get it into a data grid.
How do i do this??????

Using Active X Control(Datagrid Control) In MSAccess (NOT Resolved)
Hi,

Does anyone know how to assign a record source to a data grid control in Msaccess. Iam unable to find a Data source/Record source property/method in it.

Thanks.



Edited by - XTab on 4/8/2003 12:45:52 AM

How To Control Tab/enter Order In A Datagrid Control
Hi,

Assume i have a datagrid1 on my screen with 3 columns, name, mark and age.

I created a recordset called rst1 which sql statement is 'select name, age from student'.

I have another recordset called rst2. I appended 2 columns into rst2 using following code:
>> rst2.Fields.Append "Name", adVarChar, 20
>> rst2.Fields.Append "Mark", adDouble
>> rst2.Fields.Append "Age", adInteger

Then i copy Name from rst1 to rst2 using following code:

>> If rst1.BOF = False Or rst1.EOF = False Then
>> Do While rst1.EOF
>> rst2.addnew
>> rst2.Fields(0) = rst1.Fields(0)
>> rst2.Fields(2) = rst1.Fields(1)
>> rst2.Update
>> rst1.movenext
>> loop
>> end if

Then i set rst2 as my datagrid1's datasource:
>> Set .DataSource = adoRstQcShipmentTest

Now i got a populated datagrid with 2 columns, first column contains student names, second one is empty, third one is student age.

What i want to do now is enter mark for each student.

My Question here is how can i control the tab order? I hope the cursor can always keep in the second column (because i only need to enter data in that column). For example, when i entered mark in row 1, then i press TAB or ENTER, i hope the cursor can move to column2 in row2. But now it will move to columns3 in row1.

Please help
Grace

Beside VB 6.0's Default Datagrid && Tab Control, Which Is The Best 3rd Party Control
I m doing my new project on database application and i want my application look nice and user friendly.
I don't like the look of visual basic 6.0's default datagrid control and tab control.........Please could any one tell which is the best 3rd party datagrid control and 3rd party tab control (container).
Thankx

Beside VB 6.0's Default Datagrid && Tab Control, Which Is The Best 3rd Party Control
I don't like the look of visual basic 6.0's default datagrid control and tab control.........Please could any one tell which is the best 3rd party datagrid control and 3rd party tab control (container).
Thankx

How To Set Picture Size, Tabstrip Size And Form Size To Fit Different Resolution?
Hi all,

Just a very simple question, but just can't figure out how to set it...

I use the below code to set the tabstrip size and picture size at run-time, the width is working fine but the height will not show perfectly for every resolution set (especially 800, 600). The figure .2, .048, .04 is by try and error.... anyone have any good idea to set it no matter which resolution is used?

Code:
public sub Form_Resize

    TabStrip1.height = Me.height - TabStrip1.Top
    TabStrip1.width = Me.width - (Me.width * .2)

    For Each picture In Picture1()
    picture.width = form1.ScaleWidth * 0.048
    picture.height = form1.ScaleHeight* 0.04
    Next picture


Thanks!!

Control Size
How would I make a control that updated the size of the contents when it was modified during the design of the form?

Thank you.

Control Size
Hi,

How can I have a Control change its size in
proportion to the screen?

Thank you

Limiting The Size Of A Control
I'm working on a user control (.OCX) and need to limit the size of the control at design time. You know when you add a Winsock, ImageList, Timer, and other type controls no matter how much the user stretched the width and height those controls always retract bact to a fixed size.

I tried limiting the control's size in the UserControl_Resize Event but appearantly that doesn't get triggered during design time (I think it's triggered only during run time).

Forcing A Control To A Certain Size?
how do I make my custom ActiveX control always be a certain height and width?

Size Form To Control
Question: I've got a control that sizes automatically on the Form_Load event. I need to size the client area of the form to the size of a control...meaning I have to size the form AFTER the control is loaded.

Anyone know the appropriate API to do this?

Thanks

How Do I Make A Box The Size Of Control
well what id like to do is make a control with a shape added on it the shape will be a square

i need to know how to make the square to whatever the control size is

Control Changing Size? HELP!!!!!!
How Horrible..

I wake up.. and I put my program
on a A disk and trasfer it to
my other computer.. Went I start
VB.. I run the program and The
Backround is the same size but
every controll in the app is different.

What the heck. Everything I
try doesnt work.. Whats wrong!?????

Size Of Frame Control
Hell VB cracks,

I've got another mysterious problem. I've designed a form, but there isn't enough space for all the required controls. So, I splitted my controls in two groups. Each group of controls is grouped by a frame control. Now I tryed to switch between the two frames by clicking a command button. Both frames have exactly the same size and position, but when I hide the first frame and make the second frame visible, this frame will be displayed a little higher (about 1 pixel on the screen) than the other frame. So when you you quickly click on the button, you see the frame is "jumping" up and down. But the mysterious thing about that is, that only the upper line of the frame control is "jumping". The controls in the frames and the other three lines of the frames are not jumping like this, they keep at their position. I'm very confused about that.
I hope someone could help me with this.

Best regards

Michael Hartmann

Control Positon And Size
Hello VB_Gurus

Is there an easy way to change the Sizes and Positions of Forms, controls, etc., relative to screen resolution at run time? I don't want to change the screen resolution because some monitor cannot change to higher resolution.

Thanks in Advance.

aron

How To Re-size A Control-array At Runtime?
trying to resize a control-array at runtime, could use some help. when i say resize i mean more instances of it, not the actual size of the control.

Set Font Size On MSchart Control
Does anyone know how to set the font size for the x & y axis' on the mschart control.

I am populating it at runtime and its not formatting the fonts properly.

B.

^^Zooming A Form With Control's Size^^
Friends we know the opreration of zooming a picturebox's picture but i want to zoom all the conrols inside picturebox.
User creates some control at runtime and drags them all. NOw if he wants to see large view of that designed form to change then how can he do so?

Is ther any idea to solve this problem??

WebBrowser Control, Page Size To Fit
I want to use a WebBrowser control to display a website in a program. The Website is a standard 800X600 which requires making both the form and control very large. I would like to size the control much smaller but want the full page to show in the control without the use of scrollbars.

I have seen some posts from years ago of someone looking to do this same thing but never found a resolution to this problem.

Any ideas?

Thanks

Setting Image Control Size
In my project, I have a image box that I am displaying, but it needs to be
1KX1K in size. How do I set the Height and Width parameters of the Image control, so that it displayed on the screen in 1KX1K format?

Image Size Control (no Pun Intended)
I have a VB6 program that includes a form used to display JPG files in an Image control. Is there a way to check if the picture is larger than the form if the form is maximized on the user's screen and either 1) Rescale the image to fit, using the same ratios (stretch severely distorts the image if it's not ratioed the same as the control), or 2) add slider bars to the left and bottom of the form and add code so that the user can move the image on the form (sort of how Internet Explorer does when you view an image in it)?

I've done a comparison of screen.width to frmPMPicShow.imgPic.Width and screen.height to frmPMPicShow.imgPic.Height and for some reason it says that the image is larger than the control even though the image obviously fits in the control. I'm sure there's just a type difference there (twips vs pixels, etc) but I have no idea what it is.

Thanks in advance.

Window Size/position Control
i have shelled explorer like this


Code:
Dim One
One = Shell("explorer.exe a:", vbNormalFocus)


Now i want to control its size and position, I will alse be shelling another window,


Code:
dim Two
Two = Shell("explorer.exe C:Documents and SettingsJonMy DocumentsJon", vbNormalFocus)


and i want One to be on the left half of the screen and Two to be on the right half of the screen.

Any suggestions?
Thanks

Control Size After Minimizing - Newbie
I am trying to get all my controls on a form to be central if the form is maximised. This is working fine at the mo, but when the form is minimised, the controls dont go back to there original position. Is there an easy way to do this???
Help please.
Thanks in advance

Get File Size With Inet Control
i found this "MsgBox Inet.GetHeader("Content-Length")"
which will return the file size of a particular fiile from a server over the internet.

do i need to initialize anything before the above command returns me a correct result?

Determining Size Of Control Arrays
Hi,

I have this nagging problem. It's simple but have not found anything on the forum. I have this form with 4 control arrays with the same number of items. I need to know the size of the array such as with Ubound for normal arrays. This won't work with control arrays.

How is it done?

Mike

Web Browser Control And Text Size
Is there any way at all to increase the text size in a Web Browser Control similar to the way it is done in IE?? I've searched everywhere and so far have not found anything. Any ideas??

MonthView Control Size On Form

On many Forms it is not a problem, but one (there is always one) behaves in different way.

When I place a MonthView control on the Form, design mode, the MonthView control is smaller than on any other Forms.

I checked all Properties of Forms and they are all the same (or I can not see any differences) but MonthView control is smaller on one Form.

Any ideas? Have fun.

---- Andy

Can't Dynamically Size RichTextBox Control??
Hi

I have a user control that contains a RichTextBox in vb.net. In my
program, I create multiple instances of this control (with the
RichTextBox being in each one), that appear one above the other on a
panel. The problem is that each control may have varying amounts of
data, and so each RichTextBox (within each control) needs to size to
fit the amount of text within that RichTextBox. I've tried
multiplying the size of a single line times the number of lines in the
RichTextBox but that doesn't seem to work. Any help would be
fantastic!!!

If there is any other control (other than RichTextBox) which might
handle this better, or perhaps a third party control, I would love to
hear about it!!!!

Thanks SO much in advance!!

Control A Window's Maximum Size
With programs like Netzero (which are always on top), any window opened (IE, Word, Explorer) and maximized will fit itself around NetZero... it won't maximize behind it. How can I do that with my program? Is there a registry key I can send to?

Andrew =Ţ

MSChart Control: Problem With Size
I draw an mschart control on my form, and I set it'size as I wanted. But the problem is that if I set the mschart as XYScatter then the graph gets smaller and if I try to resize it, it grows only it's border and not the inside graph as I would like... Thanx!

Michael Vlastos
Company MODUS SA
Development Department
Athens, Greece
Tel: +3-01-9414900

Border/size Control Of External Windows...
I have an external window (non-VB) that I'm wanting to remain fixed in size (doesn't allow resizing). It's currently just a regular resizable window!

I'm currently using the MoveWindow function in a timer event; however, this still allows resizing w/ HEAVY flickering. In a timer event set to 1ms, it flickers back to the size I specify from the size the mouse has control over (hope I didn't loose you there). Is there ANY way to remove the border from an external app to make it fixed... or some other way to keep it in a fixed size (so the resize option with the mouse isn't even present)? Thanks...

- Eric

Using Inet Control To Get The Size Of A Remote File
This is how I'm trying to do this. At the end, the msgbox returns a value of 0, when the file is really around 1.7mb. What am i doing wrong?

CODE:


Code:
InternetFinish
Internet.Execute OUTSIDECONN, _
"CD myDir"
InternetFinish
Internet.Execute OUTSIDECONN, _
"SIZE /" & lstSwfs.List(x)
InternetFinish
RemoteSize = Internet.GetChunk(1024, icString)
InternetFinish
MsgBox RemoteSize

Heres the code to the InternetFinish function:


Code:
Function InternetFinish()
Do
DoEvents
Loop Until Not Internet.StillExecuting
End Function

Changing A User Control's Size At Runtime
It appears that I am only able to change a user written control's width and height property at design time but I can't see how to do it at runtime.

I have used such things as:......

UserControl.Size NewWidth, NewHeight

UserControl.Move UserControl.Left, UserControl.Top, NewWidth, New Height

UserControl.Width = NewWidth
UserControl.Height = NewHeight

.....but none of these seem to do anything at all.

In the program that is using my UserControl there will be times that I need to have the control change it's height and width that must be controled by the control's (ie. this is not a control's property that is changed by the user) logic.

Can it be done? If so, can someone tell me how to do it?

Recursive Programming - Stack Size Control
I am working with a highly recursive math program. Is there any way to increase stack size to avoid an "Out of Stack Space" error?

Thanks,
ddx

Newbie Alert - Control Size Problems
Hi there,
I've just started learning VB 6.0 and am having a few problems...

In the properties box of my form I have changed the ScaleMode to 3-Pixel. Now some of the controls (a frame) seem to be scaled in pixels and some (an image inside that frame) are in twips. Can anyone help me to make everything on the form in pixels?

(I have no idea what a twip is..)

Thanks for any help
I'm learning quite well apart from this. It's really annoying me.

Spadge

How Do I Increase The Mediaplayer Control Buffer Size
I can't see how to increase the buffer size on the
Windows Media Player Control for use in a VB project?

Internet Transfer Control Packet Size
Question on this control. There is a packet size that is set for this control. If the packet size is smaller what does that do?
What is happening is that when the server receives the packet that the length is not the same as what was sent.

This does not happen to everybody all the time. But for some customers it happens everyday, multiple times. When we go into the database and add another 'dummy' record then the process works fine.

Right now the size of the packets is 4000. We would like to lower or raise the packet size if this would help.

Using Timer Control To Increase Font Size
Hello

I am new to Visual Basic 6 and am currently trying to figure out how to do a task that I have been set. I assume it is fairly simple, but I seem to be having trouble with it!

I have a timer and a label1 with the caption of "watch the text grow". My task is to "Every second, add 5 to the label's font size (which starts at 8). When the font size grows to 70 or more points, send the size back down to 8 and start increasing the size once again." I have also added label2 to display what the fontsize is as it increases

I currently have the following code:

Private Sub Timer1_Timer()

Label1.FontSize = Label1.FontSize + 5
label2.caption = label1.FontSize
End Sub

When I run the program, according to my label2.caption, the font size is not increasing by 5 each time, but appears to be increasing by values of 5.5, 4.5, 6 and when the fontsize reaches 60 the text stops increasing. Could somebody please explain what I am doing wrong?

Copyright © 2005-08 www.BigResource.com, All rights reserved