Solved

VB Table

Posted on 2004-09-06
10
251 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
 
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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

759 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

21 Experts available now in Live!

Get 1:1 Help Now