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




Display 2 Columns In The Standard ListBox


hi all.
i have a standard listbox that will display data from a simple table.
the table has 2 fields: Name , ID
how can i show the name & Id fileds in 2 columns ?

e.g
roy 24577765
ben 65789925
joe 98125789




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
I Want To Display Data In Two Columns In Listbox And Add Items In Listbox How Is It Possible In Vb 6.0
i want to display data in two columns in listbox and add items in listbox how is it possible in vb 6.0 ...?

I Want To Display Data In Two Columns In Listbox And Add Items In Listbox How Is It Possible
i want to display data in two columns in listbox and add items in listbox how is it possible ...?

Display Listbox In Columns
hello

does anyone know how to display columns in a listbox and make each added item be aligned with the one above.

Like So:

Heading1 Heading2 Heading3
Test Test2 Test3

Cheers!

How Can I Get Unicode To Display In Standard Controls?
I've been scouring the web for days, and tried about ten different suggested methods, but none of them seem to work. So if anyone can help me please do!

I've just finished implementing a resource file string table for internationalisation string replacement, and everything is working fine. Now I just need my controls to display Unicode so I can show character sets like Chinese and Japanese.

One way is to use the Forms 2.0 Library, but not only are the not redistributable, but they are a real pain to work with, so I'm looking for other options.

I haven't as yet got anything translated to display, but the way I've been testing it is changing my Regional Options in the Control Panel to a Chinese locale and trying to display the date in my software. The date showed up fine with Chinese characters when using the Forms 2.0 controls, but several other attempts such as changing the font.charset and so on have not allowed me to replicate the results.

So any help would be greatly, greatly appreciated!

Display Standard V/s Running Data On Charts
There is a standard table for Weight of infants that has weight of a child given against the age

(in months) of the child. Example:
AgeWeight
0.52.5
13
1.53.5
24

There is a table where a doctor records the weight of the child on each visit. Based on the date

of the visit, I calculate the age of the child in months and then insert in the Visits table of

the child in the following format:
AgeWeight
.81.5
1.22.8
1.53
2.34

I want to create a chart that will display two lines:
1. The weight of the child
2. The weight of the child that should be according to standards.

I am using MSChart control for displaying charts.

How will I do it?

How To Display Icon On EXE That Only Contains A Standard Code Module??
Can someone tell me how to display an icon on a compiled EXE that only contains a standard module (ie no forms).

I was told that adding a resource file with the icon I wanted as the first icon in the file would do this, but it doesnt.

Will i have to add in a redundant form and add the icon to this ?

When I compile the project, I get an EXE with the standard VB program icon (which is a bit pants).

Any help appreciated.

Cheers


*Bane*

Display Standard V/s Running Data On Charts
There is a standard table for Weight of infants that has weight of a child given against the age

(in months) of the child. Example:
AgeWeight
0.52.5
13
1.53.5
24

There is a table where a doctor records the weight of the child on each visit. Based on the date

of the visit, I calculate the age of the child in months and then insert in the Visits table of

the child in the following format:
AgeWeight
.81.5
1.22.8
1.53
2.34

I want to create a chart that will display two lines:
1. The weight of the child
2. The weight of the child that should be according to standards.

I am using MSChart control for displaying charts.

How will I do it?

VB Standard Listbox Without Border
Hi, All

How to change VB Listbox border, using API functions?
It is possible?

Thank's,
Amaraa

How About Listbox Style 0 (standard)
code works foe checkbox listbox but not standard one ...
any idea ?

Standard Listbox And Table Field
Hi, everybody!

I have a standard list box, which is filled in by the following module: ( form load event)
===================
MyListbox.AddItem "Load"
MyListbox.ItemData(MyListbox.NewIndex) = 1
MyListbox.AddItem "Transportation"
MyListbox.ItemData(MyListbox.NewIndex) = 2
MyListbox.AddItem "Both"
MyListbox.ItemData(MyListbox.NewIndex) = 3
=========================
My list box is connected to a Data Control on the DataSource Property and to a Table Field on the DataField property. I’d like to send only the numbers (1,2,3) to the field . Have tried to change some properties, but so far I could only have the names (Load, transportation and both) stored on the table.
I’m not sure if the command <MyListbox.ItemData(MyListbox.NewIndex) = 1> is appropriate to be used in this situation.

Thanks in advance,
Roselene

Item Hot-tracking On Standard Listbox
Is this a math-way for converting the X,Y coordinates provided through the MouseMove event of a listbox, and retrieving a new value for the .ListIndex property? The result it will be the thing we call "item hot-tracking".

Too Many Columns To Display
I am writing a VB6 program drawing data from a database and display it in crystal report. However, there are too many columns to display. Now, I need to squeeze the all the columns in 1 page. Can I split the columns into more pages in the crystal report?
Headache....

Diffrent Colors In Listbox Style=0 (standard)
I need to change individual item`s colors in listbox.style=0

( looket at aaron young`s code .. works but only for listbox.style=1 (checkbox)

also I need it to change on an individual item when it is
selected ... so not WM_ITEMDRAW but rather LB_SETSEL

tried diffrent ways nothing seems to work
here`s aaron young`s modified code ...
also if I call MainOldProcAddr = SetWindowLong (Me.hWnd, GWL_WNDPROC, AddressOf WndProc)
(form load event)
I subclass using form handle ... will the WndProc intercept listbox events or when I subclass I have to use listbox handle ... ??

Public Function WndProc(ByVal hWnd As Long, ByVal uMsg As Long, _
ByVal wParam As Long, ByVal lParam As Long) As Long

If uMsg = LB_SETCURSEL Then
Dim tItem As DRAWITEMSTRUCT
Dim sBuff As String * 255
Dim sItem As String
Dim lBack As Long

Call CopyMemory(tItem, ByVal lParam, Len(tItem))
'Make sure we're dealing with a Listbox
If tItem.CtlType = ODT_LISTBOX Then
lBack = CreateSolidBrush(ITEMCOLOR) 'create brush with custom color
Call SendMessage(tItem.hwndItem, LB_GETTEXT, tItem.itemID, ByVal sBuff) 'get item text
sItem = Left(sBuff, InStr(sBuff, Chr(0)) - 1) 'filter item text
Call FillRect(tItem.hdc, tItem.rcItem, lBack)
Call SetBkColor(tItem.hdc, ITEMCOLOR)
Call SetTextColor(tItem.hdc, tItem.ItemData)
TextOut tItem.hdc, tItem.rcItem.Left, tItem.rcItem.Top, ByVal sItem, Len(sItem)
Call DeleteObject(lBack) 'delete brush
End If
Else ' any other event
Select Case hWnd
Case Form1.hWnd
WndProc = CallWindowProc(MainOldProcAddr, hWnd, uMsg, wParam, lParam)

Case playlist.hWnd
WndProc = CallWindowProc(PlOldProcAddr, hWnd, uMsg, wParam, lParam)
End Select
End If
End Function

Horizontal Scroll Bar On Standard Access ListBox?
Does anyone know how to get a Horizontal Scroll Bar to
appear on the standard Access ListBox?

I have gone through the web and find out the way to use the API to add scroll bar to the listbox in visual basic. But it doesnt seems to work in Access listbox.

I tot it's the problem of getting the hwnd of the listbox in Access, but I have found out the way to get the hwnd from the web. But still, it desnt work. It works in visual basic.

Display Rows As Columns
:SQL Server 2000

I have two tables: tblName, tblValue

tblName: contains basic information about a particular row of a record like CreateDate, ModifyDate etc.. [tblName.NameID, tblName.CreateDate, tblName.ModifyDate etc...]

tblValue: contains field type and the value for that particular field. [tblName.NameID,tblValue.FieldType, tblValue.Value etc..)


My question is how can I write a sql statement that will list all the rows from tblValue fro each row in tblName and display the value from tblValue as Colums instead of Rows:

tblName & tblValue
--------------------------------------------------
RowID CreateDate Value1 Value2 Value3 .....


Note: tblValue (currently) have 32 rows for a particular record.

Thanks in advance for your help.

-EZfriend

How To Display Two Or More Columns In A DataCombo Box
Hi, all,

I seem to have asked this question here sometime back but nooneappeared to have answered. Maybe I'll have better luck this time:

I am using databound controls on a few forms (with ADODC 2.5) and am trying my darnedest to display two/three columns in the listfield property of the Datacombo, without any success so far apparently.

How can this be done?



GoodGuy
Experience is a bad teacher for its exams precede its lessons.

Binding Two Columns And Display On Datalist Box
I am trying to bind two columns(Name and phone) and display on a DataListbox.

below's code is what I have so far, Can anyone fill me in, what I need to do, so it will display name and phone# line by line?

Thanks in advance

BTW Ignore my datagrid.


Private Sub DataGrid3_DblClick()
Dim PhoneList As String

If RowValue >= 0 And ColValue = 0 Then


PhoneList = "select Name, phone from PhoneBook order by Name asc"

Set Cn = New ADODB.Connection
Set RecSour(14) = New ADODB.Recordset

Cn.Open Production

RecSour(14).Open PhoneList, Cn, adOpenStatic, adLockReadOnly


Set Adodc4.Recordset = RecSour(14)
Adodc4.RecordSource = PhoneList
Adodc4.Refresh


DataList2.BoundColumn = "Name"
DataList2.ListField = "Name"

End If
End Sub

Display Combo Columns Question?
How can I display records in a grid when I click on a combo column?.

Perhaps this question es confuse but I saw some applications working like that. When somebody just click on a column the column shows a combo, then select an item, then when he select the item the record is displayed on the other columns just in one row, this program is a MS Access Database and it is working with ADO method. Anybody have a clue how to start bulding the DBGrid combo columns.


Thank in advance

Display Table Row & Columns On A Form?
How would one display the contents of a table on a form?

After the user provides the search criteria and a name for table about to be created, he will click the command key and the table will be created with all the data that matched the given criteria.

Then I want to show the user the data collected to see if they want to keep it or not.

I don't know how to go about this table data display. what would be the best approach?

Thanks!

How To Display Selected Columns In DataGrid
I tried searching in this forum for a solution to my problem and I didn't have any much luck. Can someone please help me in my program?

I have a table called Transaction_Detail, it has several fields but I do not wish to display all of them. I do not wish to display the SSN but I will need it later on when they update the record in the DataGrid.

Is there a way to do this?
Below is a a snipet of my code.


Private Sub cmdDisplayRecord_Click()

Set rsTransaction_Detail = New ADODB.Recordset
mysql = "SELECT SSN,Tran_ID, Tran_Seq_ID as [Seq No], Tran_Date as [Tran Date], Beg_Balance_Amt as [Beginning Balance] FROM Transaction_Detail WHERE SSN = " & CDbl(txtSSN.Text)
rsTransaction_Detail.CursorLocation = adUseClient
rsTransaction_Detail.CursorType = adOpenDynamic
rsTransaction_Detail.LockType = adLockOptimistic
rsTransaction_Detail.Open mysql, adoBenConn



Set Adodc1.Recordset = rsTransaction_Detail
Label1.Caption = Adodc1.Recordset.Fields.Count
Set rsTransaction_Detail.ActiveConnection = Nothing

Call pInitializeGrid

'Label1.Caption = CStr(rsTransaction_Detail.RecordCount)

End Sub



Thanks

Display Data In Excel Columns.
Hi,
I have some data in an Excel spreadsheet.
For Eg :
Col A : 1,2,3,4,5,6,7,8,9
Col B : 2,4,7

I want Col C = A intersection B

i.e. Col C = 1,3,5,6,8,9
All the values in Col A which are not in Col B.

thanks a lot

How To Display The Flexgrid Columns Values According To The Text
Hai friends,

   In my project, i am using Flex grid. I am adding, display(Form load, search) the description Text in the Flex grid.

    What i am in need of is, when the user searches the particular record, i want to show the whole description text in the flex grid. My description is in Column 2. I want to view all the text in that column 2. how to manipulate that.

   So far, when the user searches a record, its display in the flex grid looks( see the attachment "SearchDisplay.jpg")

  how to increase the width of the flexgrid according to the text dynamically

help needed    

Regards

Geetha

Display Multiple Records In Columns Using Data Report
i know how to display records and grouping it but im having trouble creating a report with mutiple records in columns arrange in some like this way

Boys: Girls:

name1 name2
name3 name4
name5

where either the boys column or the girls column would exceed the other

can anyone help me?

DataEnvironment's Command Creation Does Not Display Table Columns
This is really something that I can not simple understand

I have a database which resides on a SQL Server. I have created my data environment and my connection to it. Everything works fine here. Then when I create a command and go into the properties to work with a sql statement, I add the table but it does not list all the columns.

Any ideas.

Sql Query (display Two Columns From A Table In A Single Column As Distinct)
is there any way display two columns from a table in a single column as distinct

How Do I Display Multiple Columns In Detail Area In Report Designer
Hi there,
How would I display multiple columns in Detail Area of VB Report Designer? This is what I have In Report design:
ItemNumber     SerialNumber       ItemNumber SerialNumber
xxxxxxxx           999999              xxxxxxx        999999

The way that I have the ItemNumber and SerialNumber repeat themselves.  How would I display continuously.  

Any ideas would help.

regards,

Listbox Columns
Code:
List1.Columns = 2
List1.Additem("1")
how do you get it to the other column?

Thanks
-jaden

Listbox With 2 Columns
Hmm,
Any benefits from the "boundcolumn property" in regards to input/output?

Regard,

Eric

ListBox And Columns?!?!?
I have 2 column's in my list.

I would like to add Text from Tex1 to the left side and text from Text2 to the right. Is this possible? How do I go about doing this?

Thanks in advance

Columns In Listbox
Hi,

Is it possible to add items to a list box that has columns and can you add the data specifically to a column like below
for example:


Name Age Address
David 56 Any Address
Any Name 99 Any Address

any help if you understand this concept!!!!!!

Columns In A Listbox
How do you place data in the second, third, etc. column of a listbox? Here is my code to put data into the listbox, but I can't figure out how to put it in a designated column...

Do While Not Adodc1.Recordset.EOF
List1.AddItem Adodc1.Recordset.Fields("Lastname").Value & vbTab & Adodc1.Recordset.Fields("Firstname").Value & vbTab & Adodc1.Recordset.Fields("Extension").Value & vbTab & Adodc1.Recordset.Fields("DeptNumber").Value
Adodc1.Recordset.MoveNext
Loop

ListBox With 2 Or More Columns
Hello,

I need help for the following topic:

When I used VBA, I could use a ListBox with 2 or more columns.
Now I use VB6 and I can't find this option :-(
As far as I know, I can use a DataList instead a ListBox.
I already create a DataList but I have no idea how to configure a List with 2 or 3 columns :-(
How can I add a MyArray(x,y) to the DataList.

For example:
MyArray(0,0) = Name
MyArray(0,1) = Company
MyArray(0,2) = ID

Appreciate you help

Stefan

Columns In Listbox
How do I go about placing an item into the next column of a list box? What I am doing is gathering data from a database and placing the returned data into the the listbox. I want to be able to separate the data and place the data into its own column. I've tried using one column and using tabs, but it does not distribute things evenly since some results might be null. I don't want to use a List View or a data grid. I don't want to be able to select just a column, I want the entire row selected, that's why I want to use a list box. A data grid might work, but it will need to return the index number of the row in which is was found. Any suggestions???

Listbox Columns
I have this piece of code from a seminar I attended. I am trying to use it as a jumping off point for a project. However I cannot get this original code to work.

The form has a listbox (list1) and a command button(command1)

When command1 is clicked I just want to see the column headers in the listbox.

When I run the code this way I get an "Argument not optional" highlighting .List()

Code:
'First row in array will be labels.
dim LoadArray (0,2)
LoadArray(0, 0) = "PH"
LoadArray(0, 1) = "PAIR"
LoadArray(0, 2) = "NAME"

list1.list()=loadarray

with the exception of changing the string values for each array item the code is as it was in the seminar where I saw it work.

I have the columns prop. set to 3 for the listbox. Is there something else I'm missing?

As always thanks in advance for your assistence

Bart

ListBox Columns?
How would I make it so that a list box would have those button separators at the top of a list box? And how would I use the add listbox function to add text under the specified separator

Listbox Columns?
I'm doing a sort of file viewer thing with the file / dir listboxes and normal listboxes.

I choose a path and click a button then it loops through and adds each dir / file to the listbox, but is there a way to add columns that hold:

date modified & time modified & wether its a dir or file & filesize in kb & then name of dir / file

I've got the wether its a dir or file & filesize in kb & then name of dir / file but I need it in columns so it can be lined up & look neat.

Listbox With More Columns
Hi,
I have 60 items to be listed either in a listbox or in a textbox.. I want every 20 items listed in one column so that I can see them all on the form..So how should I modify a list box for my purpose...And Can I use a textbox in the same way ,too ?

Thanks

Listbox Columns
For school I need to make a listbox with two columns that can be added to, but I have searched the web and I cannot find any information that would explain to me how to do this. I have made columns, but I cannot figure out how to add to a column other than the first. I am using VB 5.0.

Listbox Columns Help
I have set a listbox to contain 2 columns, and the data on the second column doesn't show. You have to use the horizontal scrollbar to scroll right to the data in the second column. But if i set the number of columns to 3, it shows the first two together, but when i click on an item in the second column, it scrolls the list box over to show only the second column. What i want is to display both columns at the same time and when i click the second column, i want it to stay in place, not make the list box scroll. Any suggestions?

2 Columns In Listbox
Hi, i have a list box but dont wuite understand how you use the 2 columns option. I have set it to 2 columns and want only column 1 showing, in this will be filenames, and in the second not showing column will be that filenames directory. How do i do this?

To add the files to the box i have a filelist box and i add files from there.

Thanks.

Listbox Columns
I have a list box I am populating during runtime. What I would like to do is have the listbox populate in another column, say the 2nd or thrid one over. something like this


VB Code:
list1.column2.additem "something"

This obviously does not work. Is it possible?

thanks

ListBox Columns???
I was using a list view before, but now I WANT to use a listbox... how can I use the columns, so that I can put a word in the first column, then a value in the next? Right now it just looks like the columns are just to stop from vertical scrolling, but maybe its just me...

Any info on this is appreciated!

Listbox Columns
Can I have columns in a listbox?
thanks

ListBox Columns
Can i insert another column to a listbox. I mean:" I NEED TWO COLUMNS TO BE DISPLAYED?

Does anyone know any control out of vb?

Listbox --> Columns
If my listbox have more than one column, how can I choose to wich column I want my value?
If I use this everything ends up in the same column.

List1.AddItem "Test1"
List1.AddItem "Test2"

Listbox Columns
How do I create a listbox with more than one column, and get it to display column headings for all the columns?

How To Do LISTBOX COLUMNS
IF i have 3 colums and want to add a line to a text box, how can i make the first column of that link "A", the second "B", and so on... Thanx for any help i will be on AOL INSTANT MESSANGER IF YOU WANT TO CONTACT ME
====================[ AIM: sirXris ]=======

ListBox With Columns Set To Two
I'm having a problem with the listbox control.
If I set the columns to two, and set the list index to 1 (the last item) the listbox always scrolls the first item off the screen.
This doesn't happen if the box is high enough to have the two items on top of each other, but If I use a longer box with the two items side by side and set the listindex to the last item, it scrolls the first one to the left.
This doesn't happen for numbers higher than three.

If anyone has ever had this problem and knows of a possible solution let me know.

Thanks

Columns And A Listbox?
How do you use columns in a listbox?

Theres a property but how would you add data to it?

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