Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

VB Table

Posted on 2004-09-06
10
Medium Priority
?
263 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
[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
  • 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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 400 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
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

715 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