Listview: Fix Column Headers
Hallo! How can I prevent the user resizing my listview columns?
Another question: Can I set the style of a button, so that I get the look of: pushed in, when it is clicked on?
Thank you
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Listview Column Headers.
Hello All,
I'm haveing a problem with my listview object.
I onl need to have 5 columns shown on the list. However, no matter what I do there is always 6.
Anyway of changing this. I went to column headers & there is only 5 listed. Why do I keep getting six columns?
Thx
Kao.
Listview Column Headers
Hi-
I am facing problem in Data alignment(right alingment) when I am adding icon in my Listview column headers. Can anybody tell me how can I fix data as right alingment if I use icon in Listview column header?
Sohel
Column Headers In Listview
Hi-
I am trying to wrapping the column header text in two lines but I couldn't. Can anybody tell me how can I wrap/show column headers full text in two lines?
Sohel
Removing Column Headers In Listview
Hello all
I need some help with this,
I have found useful posts on this forum but couldn't find what I am looking for so if you know a post please guide me,
here is the problem:
I have a listview box that loads entries into the box a text file using the code below that I got from a post in the forum,
PHP Code:
Public Function load_listview(MyList As ListView, MyFile As String)
Dim line As String
Dim mydata
Dim row
MyList.ListItems.Clear
MyList.View = lvwReport
Open MyFile For Input As #1
mydata = Split(Input(LOF(1), 1), vbCrLf)
Close #1
'mydata = Split(line, ",")
row = Split(mydata(0), ",")
x = MyList.ColumnHeaders.Add(, , row(0))
x = MyList.ColumnHeaders.Add(, , row(1))
x = MyList.ColumnHeaders.Add(, , row(2))
x = MyList.ColumnHeaders.Add(, , row(3))
For i = 1 To UBound(mydata)
row = Split(mydata(i), ",")
x = MyList.ListItems.Add(, , row(0)).ListSubItems.Add(, , row(1))
x = MyList.ListItems(i).ListSubItems.Add(, , row(2))
x = MyList.ListItems(i).ListSubItems.Add(, , row(3))
Next i
End Function
all works well, but it seems to load the column headers twice, I am not sure why, in my text file I have the column header titles only listed once!
I want to remove the duplication in the listview for the column headers,
How do I do that?
I know that
ListView1.ListItems.Clear
Will clear the items in the listview but how do I clear the column headers?
Thanks for reading
Height Of Column Headers In A Listview
How do I control the height of a listview columnheader? This is my initializing code, and below is what comes out of it,
Code:
code, and the attached picture shows what it produces.
Private Sub InitListView2()
Dim lvw As Single
lvw = ListView2.Width
ListView2.ListItems.Clear
With ListView2.ColumnHeaders
.Clear
.Add , "Name", "Name", lvw * 0.48
.Item("Name").Tag = LVTypeString
.Add , "Address", "Address", lvw * 0.48
End With
End Sub
2-line Listview Column Headers?
I have some very long column names with very short data & would love to be able to have 2-line headers. Can this be done? (v4). Thanks.
ListView - Information & Column Headers
Hey,
I Have a listView control with two headers. ID and Name. But i want to add the information e.g
listview1.listitems.add , , ID(1) & Name("Test")
Pleaase could someone help
Regards,
Daniel
Edited by - danielgraham on 4/12/2005 12:08:21 PM
Moving ListView Column Headers
Is there a way that the user can move the Column headers of a list view control. Additionally a way to select the whole line rather than the first column.
Thanks.
Sorting A Listview By Clicking Different Column Headers
I can't seem to find a way to sort a listview based on which column header is clicked. For instance when I click on a column header that is assigned to file names I want it to sort alphabetically, and when I click on a different column header I want it to sort by date. Another column header for time...
Can anyone help?
Thanks,
Bernie
Word Wrap The Column Headers Name In Listview
Hi. I'm wondering if it is possible to word wrap the column headers so that the whole name of the column header will be seen and no ellipses will be seen to indicate that the column name is actually longer than what was shown....
I mean I have a columnheader that has a caption that requires a bigger width size. But I can only alot it to some some measurement because of the design. Can I Have it appear this way
---------------------
/ Last /
/Transaction /
---------------------
Instead of...
-----------------
/ Last Trans.../
----------------
Anyone has an idea?
ListView's Column Headers Text Color (URGENT!!)
Hi,
I need to find out a way to change the fore color of the text in the column header of a list view. So, if anyone knows anything about it, or has the code to do the same, please hit me back soon as this is really urgent.
Thanks a lot in advance.
Bye
Get Column Headers
I read an XML into Excel, then I want to get the column headers into a string array. Check the pic for explanation
Thanks
Column Headers
I have a VB6 app that returns data from a MySQL database to an Excel sheet. I can retrieve the data to Excel, but can't seem to get the column headings from the MySQL table to the Excel sheet. Can someone help me with this? Thanks.
Column Headers
Is there anyway to disable a column headers width from being adjusted during run time.
Dazza
Column Headers
How can I change the caption on a column header on a bound datagrid control?
Thanks!
Column Headers
Please help
When I try to add column headers to my list box using
Dim clmx as ColumnHeader
I am receiving an error User defined type not defined.
If I change columnHeader to object on the add method i get method or data not found. I have check other examples of code and they are doing the same. Have i missed something in the properties box. I am using VB6. Also i am trying to add this in the Sub Form_Load()
thanks for any suggestions.
Kezza
MSHFlexGrid Column Headers
I sure hope someone can help...
I am using an MSHFlexGrid, and the second band is displayed verically. I have the second band set to display column headers. However, after I rebind the grid with new data they are no longer there. I am running this after I rebind, but it still doesn't show:
Me.grdInvoice.ColHeader(1) = flexColHeaderOn
Any thoughts?
Listbox Column Headers Name
Hi,
I have a userform in Excel VBA which is connected to Access database.
there is a listbox in that userform and through SQL query I take the data from access table and add it to the listbox.
I know how to make it multi column listbox,currently I am using columncount property as 5 so there are 5 column.
the problem is that I don't know how to name the headers.
I know to use rowsource but I only can use it when data is from excel sheet. but in my case I need to get the data from access table.
can somebody please help how to get the headers name
Thanks
Column Headers In A ComboBox
Hi.
VBA - Access
I have been working on a way to put all the headers from a Table called "Data" into a combobox. The column headers aways change so i cant just add them.
Ive been trying to write a SQL statement but i never did SQL in my studies. But i think it would be the best way to do it. So an examples on this would be great.
Thanks.
Column Headers And Icons
Windows Explorer indicates the sort column/direction by an arrow icon placed after the columnheader. Selection of any particular header does not affect the alignment of that column.
I have searched previous posts, and have learned how to show or hide the icon in a listview control, but have not been able to place the icon after the columnheader. One of my columns has alignment lvwColumnRight. When the header is selected I show the icon, (on the left, because that is the best I can do), but I am unable to prevent the column reverting to alignment left.
Column Headers In Listboxes
hi,
how can i add column headers to my listboxes, just like in windows file explorer in the "details" view, is it a standard listbox or is it a special active x control?
cao
mirza
Get Column Headers In Datagrid
Hi all!
I would like to ask if anyone knows how to get the names of the column
headers from a datagrid?
My grid is populated at run from an excel file. So the column names are not defined at design time.
Please help.
Column Headers In Listbox
Hello People,
I have a listbox on a form which is called by the following:
VB Code:
Call Pg1aList(reclist)
Where reclist is the name of my Listbox and Pg1aList is this function:
VB Code:
Public Function Pg1aList(lstholder As ListBox) On Error GoTo ErrHandler Dim pg5 As ADODB.Recordset 'Dim strText1 As String Set pg5 = MyConn.Execute("SELECT RecID, indname, datedeveloped FROM apprecords") lstholder.Clear With pg5 Do Until .EOF lstholder.AddItem (pg5("indname")) lstholder.ItemData(lstholder.NewIndex) = pg5("RecID") .MoveNext LoopEnd With Exit Function 'error handlerErrHandler: MsgBox Err.Description pg5.Close Set pg5 = Nothing End Function
This works fine, but I would like to have the two column names that I am using brought into the top of the Listbox as well. I basically want Name and Date to appear at the top of the Listbox, and then all the necessary records.
Any ideas on how I do this...??
Any help would be appreciated,
Al...
ListBox Column Headers
I know how to add columns headers (Icons and text) but, how can I add data under them. I use this:
Code:
with listbox1
.listitems.add , , "This is an Item", 1, 2
.listitems.add , , "This is another Item", 1, 2
end with
to add items to my listbox. Now, these go under the first column header, how can I make the code so there is some under the second and the third column header.
Thanks!
MSHFlexGrid Column Headers
I have an MSHFlexGrid filled via the code:
Set MSHFlexGrid1.DataSource = Adodc1
I want its column headers to be different from the field names of the Adodc1's Select statement. I want to accomplish that without using the As+Alias structure. Ex:
Adodc1.RecordSource = "Select LName From Customers"
Set MSHFlexGrid1.DataSource = Adodc1
Now, I want the column header of MSHFlexGrid1 to be Last Name, but without using:
Adodc1.RecordSource = "Select LName As [Last Name] From Customers"
DataGrid Column Headers
Hello,
Is it possible to center a DataGrid's column header at runtime? I can center the values in the DataGrid's columns by using DataGrid1.Columns(i).Alignment = dbgCenter but I cannot figure out how to center the Column Header.
Thanks so much.
Stephanie
TreeVeiw & Column Headers
Can anyone tell me how to asign info under two different column headers in a list view using info from tree view
Thanks
Grouped Column Headers
Is there some way (API, subclass, ... ) to group two or more column headers in a (Visual Basic)ListView (Mscomctl.ocx v. 6.1.83.41), like is MSFlexGrid ???
Rogério Weinert
MSHFlexGrid 2nd Band Column Headers
I have an MSHFlexGrid contol set up to display my bands of data vertically like this:
Parent Info
Child Info 1
Child Info 2
Child Info 3
Where my Parent Info is Band(0) and my Child Info's are Band(1). If I select the option of showing Column Headers for my Child Band it shows a header before every child record. Is there any way to have it show just once (before the first record)?
Hope someone can help...
Thank you!
Multi-Column ListBox Headers
Hiya.
I'm attempting to display a list of stuff using a multi column listbox on a UserForm.
I want each column to have a header, but **** man, I can't get them to display.
I can only find examples on the Internat where the RowSource property is pointed to a table of cells on a worksheet.
I want to set the column headers from within VBA.
Possible???
How Do You Show Listbox Column Headers???
Hi everyone, I hope this is simple...
I have a listbox created from a file, which scrolls both vertically and horizontally.
I want to protect my column headers from being deleted, and set column headers to true in the properties, however, nothn happens, I get a blank column at top of listbox. I obviously need to something else here, but what is is it??? I am puzzled!
Flexgrid Column Headers/colors
Hey guys! I'm trying to learn how to use the flexgrid, and I have some questions about column headers and colors. First, is there a special column header feature, or are you just supposed to create your own headers? Second, what is the syntax for changing the background color of a specific row? Thanks for all the help.
Edit Column And Row Headers In FlexGrid
i'm using the EdFlexGrid very similar to MSFlexGrid and want users to be able to change the values in the greyed out column and row headers that are Greyed out. The only one I dont want them to be able to chane is the very top left header that isnt in any particular column or row. Thanks for your help
Column Headers In List View
Hi
I am at present conducting search on my listview using finditem method, which works well on the first coulmn (text) better then the othercolumns (subitmes).
I wonder if it is possible to make the subitems as the first coloumn (text) so that I can conduct searches on that specific coloumn.
Does anyone know how to do this dynamically at run time?
Regards
Yamin
Flexgrid Column Headers Blink
Hello, I have come across a weird problem. I have a form, that has a flexgrid on it. Data is received from a MySQL database...on windows 2000 computers, when the form opens, it almost appears that a key on the keyboard is stuck...and the column headers 'select' one at a time....then move to the next...and next...and next....and keeps doing this. However, on XP systems this doesnt happen. Below is my code:
Code:
Public Sub FillFlex2()
Dim i As Integer
On Error Resume Next
'lstPartNumbers.Clear
Flex.Clear
FormatContentsFlex
If rsMySQL2.RecordCount > 0 Then
Flex.Rows = rsMySQL2.RecordCount + 1
Flex.Cols = 6
Flex.FixedRows = 1
Debug.Print rsMySQL2.RecordCount
'rsMySQL2.MoveLast
For i = 1 To rsMySQL2.RecordCount
Flex.TextMatrix(i, 0) = rsMySQL2.Fields("BarCode") & ""
Flex.TextMatrix(i, 1) = rsMySQL2.Fields("ItemCode") & ""
Flex.TextMatrix(i, 2) = rsMySQL2.Fields("ItemDesc") & ""
Flex.TextMatrix(i, 3) = rsMySQL2.Fields("LotNumber") & ""
Flex.TextMatrix(i, 4) = rsMySQL2.Fields("Pounds") & ""
If strFromForm = "frmShopFloor" Then
If rsMySQL2.Fields("Location") Like "*H1*" Then
Flex.TextMatrix(i, 5) = "Hopper 1"
ElseIf rsMySQL2.Fields("Location") Like "*H2*" Then
Flex.TextMatrix(i, 5) = "Hopper 2"
Else
'Flex.TextMatrix(i, 5) = rsMySQL2.Fields("Location") & ""
Flex.TextMatrix(i, 5) = "Press: " & rsMySQL2.Fields("Location")
End If
Else
Flex.TextMatrix(i, 5) = rsMySQL2.Fields("Location")
End If
rsMySQL2.MoveNext
DoEvents
Debug.Print i
AdjustGridColWidth Flex, lblCount, i, 0
AdjustGridColWidth Flex, lblCount, i, 1
AdjustGridColWidth Flex, lblCount, i, 2
AdjustGridColWidth Flex, lblCount, i, 3
AdjustGridColWidth Flex, lblCount, i, 4
AdjustGridColWidth Flex, lblCount, i, 5
Next i
Flex.Width = Flex.ColWidth(0) + Flex.ColWidth(1) + Flex.ColWidth(2) + Flex.ColWidth(3) + Flex.ColWidth(4) + Flex.ColWidth(5) + 100
'frmContents.Width = Flex.Width + 230
'lblCount.Width = frmContents.Width
Flex.ColAlignment(0) = flexAlignLeftCenter
Flex.ColAlignment(1) = flexAlignLeftCenter
Flex.ColAlignment(2) = flexAlignLeftCenter
Flex.ColAlignment(3) = flexAlignLeftCenter
Flex.ColAlignment(4) = flexAlignLeftCenter
Flex.ColAlignment(5) = flexAlignLeftCenter
End If
Flex.Width = Flex.ColWidth(0) + Flex.ColWidth(1) + Flex.ColWidth(2) + Flex.ColWidth(3) + Flex.ColWidth(4) + 100
frmContents.Width = Flex.Width + 230
lblCount.Width = frmContents.Width
If rsMySQL2.RecordCount > 1 Then
lblCount2.Caption = rsMySQL2.RecordCount & " materials found."
ElseIf rsMySQL2.RecordCount = 1 Then
lblCount2.Caption = rsMySQL2.RecordCount & " material found."
Else
lblCount2.Caption = rsMySQL2.RecordCount & " materials found."
End If
End Sub
Public Sub AdjustGridColWidth(pobjGrid As MSFlexGrid, _
pobjLabel As Label, _
plngRow As Integer, _
plngCol As Integer)
'-----------------------------------------------------------------------------
' Adjusts the width of a flexgrid column, using the width required by a
' label using the same font, fontsize, and width. The label used must have
' Autosize = True and WordWrap = False.
' Also, the WordWrap property of the flexgrid must be set to True.
With pobjGrid
.Row = plngRow
.Col = plngCol
pobjLabel.FontName = .CellFontName
pobjLabel.FontSize = .CellFontSize
pobjLabel.Height = .RowHeight(.Row)
pobjLabel.Caption = .Text & " "
If pobjLabel.Width > .ColWidth(.Col) Then
.ColWidth(.Col) = pobjLabel.Width
End If
End With
End Sub
Export Column Headers To A CSV File
I am using this code:
Write #1, List1.ListItems(i).Text, List1.ListItems(i).ListSubItems(1).Text, _
List1.ListItems(i).ListSubItems(2).Text, List1.ListItems(i).ListSubItems(3).Text, _
List1.ListItems(i).ListSubItems(4).Text, List1.ListItems(i).ListSubItems(5).Text
It works, but there could be more than the 4 rows. Is there a way of exporting this according to the number of columns (each has to be seperated by a comma and has to be one command)?
Write x, y, z, ...
I can get the column headers into a temp var, but it copies all headers into a single cell (spreadsheet)
For i = 1 To List1.ColumnHeaders.Count
tmpHeaders = tmpHeaders & "," & List1.ColumnHeaders(i).Text
Next i
thanks
Menu's & Row/Column Headers In Excel
Hi,
I want to remove the Row & Column headers when I open a particular Excel Workbook.
I know that I have to do any changes in the Procdure Workbook_Open, but what do I use?
Also I want to create a menu bar and then only show that, is there a way?
Regards
MSHFlexGrid & Changing Column Headers
I have MSHFlexGrid bound to a hierarchical recordset (defined via the standard DataEnvironment). What I want to do is change the column headings from their database column names to something a bit more readable. I have a function that queries a table containing the column name and a display name (GetFieldNameDesc). My thought was to loop through the column headers in the grid and replace the column name witht he display name. Here is the code:
Code:
'Update column headings
Dim S As String
Dim i As Integer
Dim n As Integer
i = MSHFlexGrid1.Cols - 1
n = 0
While n <= i
S = MSHFlexGrid1.ColHeaderCaption(0, n)
MSHFlexGrid1.ColHeaderCaption(0, n) = GetFieldNameDesc(S)
n = n + 1
Wend
Now, in debug, I can step through this code and it works fine. Checking the MSHFlexGrid1.ColHeaderCaption(0, n) after the reassignment seems to be fine. However once the form actually comes up, none of the new column headers are in place. I am doing this assignment routine at the tail end of the form load event.
My only thought on why this doesn't work is that it has something to do with this grid being bound to the hierarchical recordset, and maybe those column headers really aren't updateable.
Although, I have done this very same thing with a VSFlexGrid bound to a regular recordset.
ANy clues?
MSFlexGrid Overwrites Column Headers?
Hi everyone. My first post - thanks for looking! I'm populating an MSFlexGrid with data from an access97 file. My code was created from the following example:
Private Sub Form_Load()
MSFlexGrid1.FormatString = "Artist Name |" & _
"Album Name | Tracks"
Data1.DatabaseName = App.Path & "CDCollection.mdb"
Data1.RecordSource = "select * from CDs order by ArtistName"
End Sub
The last line (Data1.RecordSource =) when run causes the FormatString property to be blown away. That is, the column headers are replaced with the database field names. Has anyone seen this before? The example seems simple enough but I just can't get it to work. I even thought there may be a problem with the version of my component and upgraded my VB but still have problem. I've tried setting the FormatString at the end, refreshing, still nothing...
Thanks!!!
Include Column Headers From ADO Recordset
I'm truly vexed. Here's my code to populate grid:
Public rsHandle As New ADODB.Recordset
Public strHandle As String
strHandle = "SELECT Results.*"
strHandle = strHandle & " From Results"
strHandle = strHandle & " WHERE (((Results.shipdate) Is Null));"
With rsHandle
Set .ActiveConnection = cnnCei
.CursorType = adOpenKeyset
.CursorLocation = adUseClient
.LockType = adLockOptimistic
.Open strHandle
End With
flxHandle.Rows = rsHandle.RecordCount + 1
flxHandle.Cols = rsHandle.Fields.Count + 1
For k = 0 To rsHandle.RecordCount - 1
For j = 1 To rsHandle.Fields.Count
If IsNull(rsHandle.Fields(j - 1)) Then flxHandle.TextMatrix(k, j) = ""
If rsHandle.Fields(j - 1) > 0 Then flxHandle.TextMatrix(k, j) = rsHandle(j - 1)
Next
rsHandle.MoveNext
j = 1
Next
So how about those column headers? Where are they?
|