Solved

VB Table

Posted on 2004-09-06
10
254 Views
Last Modified: 2010-05-02
Hi All,

I would like to build a simple VB application in which I will display data from a text file, organized in a table.
Clicking on each field, in a row, of the table, will open another dialog.

At first the table will have no lines, but as it reads (in real-time) the text file, it will start displaying the rows of data, according to some rules. Once the length of the table exceeds the length of the form, a vertical scroll bar will appear to allow to scroll up & down, to see the different rows in the table.

My Main question is what control should I use for the table ?

In addition - Can anyone give advice on how to do this? I'm not a VB expert so please keep it simple.

I'll be glad to get links to sample code.

Thanks.
0
Comment
Question by:chayahd99
  • 4
  • 3
  • 2
  • +1
10 Comments
 
LVL 18

Expert Comment

by:JR2003
ID: 11991769
Do you want to click on a row or a field?
The standard  controls to use are a Listview or a Flexgrid.
You may have som problems detecting which field is clicked on for a Lstview though the control itself is much nicer to use.
0
 

Author Comment

by:chayahd99
ID: 11991838
I want each row to contain 3 buttons/labels so each can be clicked seperately.

I believe ListView treats each row as one entity.
What is FlexGrid ? That sounds interesting...
0
 

Author Comment

by:chayahd99
ID: 11991925
The FlexGrid looks good, I just have 2 questions I couldn't find answers for:

1. Must I bind it to a data source or can I just read data from the text file & display it in the grid?

2. Can I get rid of the bands so they don't appear at all ?
0
Is Your AD Toolbox Looking More Like a Toybox?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
LVL 8

Expert Comment

by:mladenovicz
ID: 11994584
1. you can add data manualy (without datasource) use vbtab as column separator

Private Sub Form_Load()
    mfg.Cols = 3
    mfg.Rows = 1
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
    mfg.AddItem "a" & vbTab & "b" & vbTab & "c"
End Sub

2. I am not sure if I understood you properly, but check the followinf grid properties: FixedCols, FixedRows, GridLines, GridLinesFixed
0
 
LVL 3

Expert Comment

by:redfordb
ID: 11994645
I would recommend the Listview control at vbaccelerator.com (http://www.vbaccelerator.com/home/VB/Code/Controls/ListView/article.asp).
It has some very nice added functionality over the standard listview control.
0
 

Author Comment

by:chayahd99
ID: 12003876
mladenovicz,

When I add items to the FlexGrid as you explained, can I define some of the items to be buttons or other controls or could they display only text ?

redfordb,

Does the Listview control at vbaccelerator.com enable clicking on each of the cells to open another dialog ?
0
 
LVL 3

Expert Comment

by:redfordb
ID: 12003906
Yes
0
 
LVL 8

Expert Comment

by:mladenovicz
ID: 12004318
I don't think so. Actually, I am using 3rd party flex grid (VideoSoft Flex Grid - www.componentone.com) that have possibiltiy to display checkboxes, combo boxes, ...
0
 

Author Comment

by:chayahd99
ID: 12004494
redfordb,

Does the Listview control enable embedding controls (buttons, checkboxes, combo boxes, etc...) in the grid ?

Is it free ?

Thanks.

0
 
LVL 3

Accepted Solution

by:
redfordb earned 100 total points
ID: 12004551
The control is freeware, but to my knowledge you cannot bind controls to cells.

The S-Grid control on the same site can bind any control to a cell and is also freeware.
http://www.vbaccelerator.com/home/VB/Code/Controls/S_Grid_2/S_Grid_2/article.asp

0

Featured Post

Does Powershell have you tied up in knots?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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 Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

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