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




How Do I Hide/unhide Columns In A List View?


I want the user to choose the columns for a specified output though all the columns will be filled

with data , i want to display only those columns which the user selects.Currently i make the width

of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to

see the hidden column. How do I actually hide it???




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
2 Qs : Timer And How Do I Hide/unhide Columns In A List View?
hi,
2 questions
For a listview, I want the user to choose the columns for a specified output though all the columns will be filled with data , i want to display only those columns which the user selects(Like we have it in windows explorer). Currently I make the width of the hidden column as - 0 but that the user can just keep his mouse on the header and drag to see the hidden column. How do I actually hide it???

Second question:

I have just recently find out that one cannot set the interval time of a timer for than 65000 millisecs that is apporx a minute. How do I set the interval of a timer for more than a minute say 3 minutes?

Thanks.

Hide/Unhide Columns With One Button
Hi,

I have recently written a macro that hides and unhides a specified number of columns, but would like to build an If statement to consolidate the macro into one procedure. Here's what I'm trying to do...

I have data in columns ("A:F") and would like to be able to hide and unhide columns ("B") with the same button. So, if I click the button once, it will hide columns B,C,D. If I click the same button again, it will unhide columns B,C,D. On the third click it will once again hide the three columns.

Any help would be greatly appreciate. Thanks!

List View Column Hide
Hi all,
I have a list view control with 3 columns, I do not want to display 1st column. Does any one know how to do this

Thanks

2 Columns In List View:
i ahve a list view box, when i click the add button, i need to be able to add:
add.text in the first column
desc.text in the second column

but i can only get add.text in the first column.......

How To Hide A Column In A List View Control
I need to hide a column of list view dynamically so that perticuler column is not resizable and the column is obsolutely hidden.

Please respond..

Suresh

Ordering Columns In A List View
I know I can use the ascending and descending properties to order the first column in a list view, but how can I order the other columns as well?

Listview Columns In List View
I am trying to use Listview to import data from an Access table and I only want to use the list view not the list report. The data imports OK and populates the list OK into (in this case with the quantity of data imported) 4 columns.

Trouble is, all the data is truncated and I can find no way of setting the column widths as you can in the normal list box. I do not have any sub-items, just a single list so I do not need to set up any column headers.

List View Select - Multiple Columns
I have a listview control with two columns...

1. File Name
2. Extension

When I selected the file I return the file name, but if i want to retrieve the properties regarding the file i need the extension which is in column 2...

This will get the information in column 1 (File Name)

Set objFile = objFSO.GetFile(DirList.List(DirList.ListIndex) & "" & lstFileList.SelectedItem.Text)

How do I get it so that it gets the info in column 1 and adds the info of column 2 to that string? i.e.

file name extension
mydoc doc
myvideo avi
myemail eml

i want it so that when i click on mydoc the string becomes... mydoc.doc, any ideas? thanks
- gabe

Sorting On DATE Columns In MS List View
Does anybody know how to get this to work?

The listview seems only capable of accepting strings as it's items so dates have to be converted to text and therefore are sorted as text.

How can I get around this?

Freeze The Columns Of List View Control
Hi Gurus,
I want to freeze the columns of a Listview control in Report view mode. Is there any property of List View or any other code example to show me how to prevent the columns to be resized by the user?

Help me plz, it is really necessary.

Waqas...

Unhide/hide
I have a button that when the user presses the button the program will search
an ordered column for values equal to 0 and hide the rows that has values
equal to zero. If the rows already are hidden then they shall be revealed by
pressing the button. My code is:

Sub showHideButton_Klicka()
Dim relativCell As Range
Dim i As Integer, j As Integer, k As Integer
Dim blnFirstFound As Boolean, blnLastFound As Boolean, blnIsHidden As Boolean

Set relativCell = Worksheets("Beräkning").Cells.Find("Rel.", LookIn:=xlValues)
'hittar första och sista cell med värde 0
Do Until IsEmpty(relativCell.Offset(i, 0)) = True Or blnLastFound = True
If blnFirstFound = False Then
If relativCell.Offset(i, 0) = 0 Then
blnFirstFound = True
k = i
Else: End If
End If

If blnFirstFound = True And blnLastFound = False Then
j = i
If relativCell.Offset(j + 1, 0) <> 0 Then
blnLastFound = True
Else: End If
Else: End If

i = i + 1 'längst ner i listan
Loop
'**** hittar första och sista cell med värde 0


'markerar rader med cell värde 0
startRow = relativCell.Offset(k, 0).Row
endRow = relativCell.Offset(j, 0).Row
Rows("" & startRow & ":" & endRow & "").Select

'här ska man gömma
If blnIsHidden = False Then
Selection.EntireRow.Hidden = True 'gömmer rader
blnIsHidden = True
End If
'**** gömma

'start ta fram
If blnIsHidden = True Then
Selection.EntireRow.Hidden = False 'gömmer rader
blnIsHidden = False
End If
'**** ta fram

End Sub

this does not really work since blnIsHidden is false when the sub starts. And then when i hide it becomes true so it automatically hides and then unhides. what i want to do is to hide if not hidden and unhide if already hidden..I just cant figure out how to do it. i thought about using two buttons but how do you keep the selection of the rows? If you know what I mean please help me out! Thank you all very much!!!

Hide / Unhide Row
Hi have a spreadsheet which values allway change based on the text feilds used on th userfrom.

What I would Like to do is Hide

Row 8 if cell E9 is blank.

The challenge that I'm having is Cell E9 could be blank then have a value the next time. I have this could which I tried to change but no luck.


Help Please

Private Sub Afterupdate()
Dim x As Range
Dim y As Range
Set y = Range("E9")
Application.ScreenUpdating = False

For Each x In y
If x.Value = 0 Then
x.EntireRow.Hidden = True
End If
Next x

Application.ScreenUpdating = True

Cells.EntireRow.Hidden = False

End Sub

Best Way To Hide/Unhide
I have a few controls, and the user can select to use them or not, though a options box. And what I want to do it if the user wants it, it will show and if not, it wont, but at the same time adjust the size of the frame according to what options the user wants...

Now what would be the best way to do this?

Also what are VERY user friendly colors for forms?

Thanks alot,

Adam

List View Find Text By Corrosponding Columns
Hi, i have a list view with 2 coumns and it retrieve information from a server and it contains different amounts of information at once.

What i need to do is locate in the first column of the listview anything containing
the index "hostname" then go retrieve the hostname which would be in the next column in the exact row. So it looks like this

Column 1 - Column 2
=====================
ip add - 192.168.blahblah
hostname - TheTestName

i want to retrieve "TheTestName" by finding the column "hostname" but i have no ideas how to achieve this. If anyone could help me out that would be great.

How To Sort Columns In List View -- Just Like Windows Explorer
Hi,

I am using ListView Control.. I want to sort the listview on a particular column when user selects it. Is there any direct way of doing this.. And can I set colors to rows in a Listview control.. Like I have a situation where I want alternate colours to be displayed.. Is it possible

Regards

Surya Prakash

Hide And Unhide A Text Box
Hi Folks,
My problem is simple. I have a simple form in Access that is just a few text boxes and a couple of tick boxes.
All I want to do is make the tick box make one of the text boxes visible or not visible depending upon the status of the said tick box. This I can do, but...the only problem is that the tick box is not specific to each form or record. So when I tick or untick the box the textbox is either visible or not visible but for all the records/forms and not just each individual form/record.
Any help would be great!
Thanx

How To Hide/Unhide Taskbar Of Other PC?
i'd like to know How to Hide/Unhide Taskbar of other PC when both pc are connected in network.

Hide/Unhide Button
Hello,

Can anyone tell me how I can Hide/Unhide a button with a checklist?

This is the situation:
I've got at the end of my spreadsheet a button and a checklist.
What I would like to see is that when I ot an X in the checklist, my button appears to send an e-mail to me. (This mailing thing already works btw.) And if I don't activate my checklist, there isn't a send button.

 Or is this not possible at all? Please let me know!

Hide/unhide A Form Column Using VBA
How can you hide/unhide a column in a form that is in datasheet view using VBA ?

I have tried


Code:
Forms!FormName.ControlName.Visible = True
Forms!FormName.Refresh

Thanks

Trap A Hide And Unhide Row Event?
If am using a Function that simulats the Subtotal formula in xl2003 which takes account of hidden rows and does not total them.

Code:
Function EWSUBTOTAL(Fuction_ref, SelectedRange As Range)


Dim Rng As Range, a As Range
Dim Subtotals As Long, Celltotals As Long

If Fuction_ref = 109 Then

For Each Rng In SelectedRange
If Not (Rng.Rows.Hidden Or Rng.Columns.Hidden) = True Then
If Not IsEmpty(Rng.Value) = True Then
If IsNumeric(Rng.Value) = True Then
EWSUBTOTAL = Rng.Value + EWSUBTOTAL
End If
End If
End If
Next Rng
End If

If Fuction_ref = 102 Then

For Each Rng In SelectedRange
If Not (Rng.Rows.Hidden Or Rng.Columns.Hidden) = True Then
If Not IsEmpty(Rng.Value) = True Then
If IsNumeric(Rng.Value) = True Then
EWSUBTOTAL = EWSUBTOTAL + 1
End If
End If
End If
Next Rng
End If

End Function

It works fine (a bit slow) but thats ok

However I find that in excel 2003 when I hide or unhide a row it recalculates automtically and my function updates.

BUT in xl2002 or earlyer it does not recalc on a hide or unhide a row event

Is there a way to trap this event (change event does not work)
and run an application.calculationfull

Thanks

Objects - How To Hide/unhide These In Excel App?
Should be simple , but how to hide/unhide objects (forms) in Excel and make them reappear in the same location?

Thanks!
Spockez

How To Hide And Unhide An Item In Listview
I want to let the listview user select an item and its subitems and hide it ,i.e., make it invisible, but not removed from the list.

In listview properties I have checked HideSelection and FullRowSelect.

The following code does not generate a complier error message, removes an item properly, but does not hide the selection - just leaves it highlighted.

What am I missing here. I think I've tried about every other option and only get error messages.

Private Sub ListView1_ItemClick(ByVal Item As MSComctlLib.ListItem)
Dim Reply As Integer
Reply = MsgBox("Are you sure you want to delete this entry?", vbYesNo + vbQuestion, "File Mgmt")
If Reply = vbYes Then
ListView1.ListItems.Remove (ListView1.SelectedItem.Index)
Else
ListView1.HideSelection = True
End If
End Sub

Hide And UnHide Systray Clock ??
Hi...how do I hide and unhide the Systray clock ?

Hide/Unhide File Folder
I want to Hide/Unhide a File Folder with one button click.
Any ideas?

Maybe later I want to password protect folder/file access also.

Houw To Hide And Unhide Optionbuttons
hey,

I try to make a form in Access2000 with 20 optionbuttons.
When the form load, i try to hide a copple of optionbuttons.

Houw can i make all of the buttons a index
the caption of the buttons is "optanswer" and a number after the caption.

when there is in a tabel the value "4" then the first 4 optionbuttons may be visible, the rest must be hide.

when there is in a tabel the value "6" the 6 first option buttons may be visible, the rest must be hide.

Help, help and .............

I just a beginning vb user so, if it is possible, the full source code please.

caption optionbuttons :
button1 ---> optAnswer1
button2 ---> optAnswer2
Ets, ets,....
cellname in tabel "testtbl" with the value of the buttons = "testaantal"


Best Regards

[Edited by expodium on 04-25-2000 at 09:12 AM]

How To Hide Or Unhide Shutdown Menu
dear all , i need your help.

how to hide and unhide shutdown menu????, i use windows 95,98,ME,NT 4.0 and
2000
i develop my project with visual basic 6.0



Thanking you in advance,



eddy

At 08:40 8/19/2002 -0400, you wrote:
>Visual Basic daily news - http://www.ittoolbox.com/i/vb1.asp
>I've got about a dozen different barcode readers. NONE require any special
>software. The computer thinks the keyboard is actually entering the data.
>

AD Script To Hide/unhide User From The GAL
Hi all,

Would appreciate your assistance on this one. I am looking to write a VB script to traverse through all the Disabled User's in Active Directory, and tick/untick the 'Hide from Global Address List' feature (an Exchange property). Can anyone get me started on this?

Thanks

Open/Close Vs Hide/Unhide Forms
I have an application which starts with a Main Screen. From there, you open a Form where the user selects a Job they want to edit. Once they select a Job, it then opens an Edit Form and from there, they can go to the 'Select For Print' Form which allows them to chose records to print before actually printing. The problem is that I am not controling the forms efficiently.

Currently, I close most of the forms once the user moves on, but then I have a BACK button on most forms which allows the user to step back one form. When they do so, I was re-opening the forms (DoCmd.OpenForm). I think this is eating memory when I am constantly opening and closing forms. I want to understand how to just hide them and reload them when the user presses BACK rather then open and close. Here is the hierarchy so you can better understand the flow:

Main Screen (cmd button to open Job Select)

Job Select (cmd button to open Edit Job, cmd to go back to main)

Edit Job (cmd button to open Select for Print and cmdbutton to go back to Job Select)

Select for Print (cmd button to open Report and cmd button to go back to Edit Job and one to return to Job Select)


The Edit Job and Select For Print forms are being sent a filter in the DoCmd WHERE clause to filter out only the job in question. I wasn't sure how to hide/unhide or actuivate/unactivate the forms and then refresh with the new filters each time.

I guess what I am asking is when the user goes to the Job Select Form from the Main Screen, I want to just hide the Main screen so they can easily go back to it later...then from the Job Select, be able to go to the Edit Job and hide the Job Select so it can be returned to.

The other tricky part for me is then going to the Select For Print screen... currently, i have the Select For Print just opening OVER the Edit Job screen so that when the user clicks the BACK button from the Select For Print, it just closes the Select For Print which puts them back onthe same record in the Edit Job. However, if they make a change and then click the 'Select For Job', I am REOPENING using the DoCmdOpenForm which I think will be slow and eat memory.

What I would ideally like to do (if it is the most efficient) is just open all of the forms needed, and then just pass the filter each time I call the form and hide the others. Which property do I use for this type of control? (activate, hide, load, etc)....Also, what is the proper syntax for changing Form properties from within a different form?

I am sorry this is confusing...if I left anything out (like the fact that I am using Access 2000 ), just let me know.

Thanks for any help.....and thanks to anyone who can understand what I am asking here

[NOT RESOLVED]How To Hide/Unhide Taskbar Of Client PC?
i'd like to know How to Hide/Unhide Taskbar of client PC connected in a network(server).
and also how to deactivate desktop?



Edited by - edd_hills on 5/22/2007 7:45:41 AM

Hide/unhide Rows/cols On Cell Click
I have an VB 6.0 app that is creating an excel report.

I am trying to make it so that when the user clicks on a cell, some event code must be run.

The event code would evaluate neigboring cells and hide/unhide rows/cols accordingly.


NOTE:
The app copys a template file to local drive and then adds data so I have the option of embbedding a macro in the template.


SO how can i make the xlApp trigger on the cell click?
Also, I do have the option of putting a button in a cell if clicking on the cell wont work.
But then how do I add I button programatically via vb6.0?

Hide Rows Or Columns
An interesting code, for us working with complex spreadsheet, would be to know how to create a macro that would remove an entire row containing ZEROS in the cells. In example below, only the Account#70200 row should be hidden (NOT the 70400).

Example:

Account# January Feb March
70100 1,000 2,100 3,000
70200 0 0 0
70300 1,200 1,100 2,000
70400 0 2,100 2,100

Similar trick for hiding columns with zero or no values would be very usefull.

Hide All Unused Columns
Servus again,

I want to integrate a macro, that hides all unused (=empty) columns. But: the empty column, that follows directly to a not-empty column, is supposed to be unhided.
E.g.: A is empty --> hide. B is filled --> unhide, C is empty --> unhide because it follows directly to B ...

The code does not seem to work, but i don't know why... Any idea??

Here is the code:

Sub LeerKiller()
Dim row, col, dist, cont As Long
dist = 0
cont = 0

For col = 1 To 300
For row = 1 To 65000
If Not Cells(row, col) = "" Then
Columns(col).EntireColumn.Hidden = False
cont = cont + 1
Exit For
End If
Next row
If cont = 0 Then
Columns(col + 1).EntireColumn.Hidden = True
End If
Next col
End Sub

MSHFlexGrid Hide Columns
I am filling a mshflexgrid with a recordset of 4 fields. I only need to show
two of the fields in my flexgrid, and the other two fields I only need for calculation. How can I handle this ?
The grid have 4 columns; column 1 and 2 should be from the recordset, and
column 3 and 4 is additional fields. Hope someone can give me some good ideas.

How To Hide MSFlexGrid Columns
I use flex.ColWidth(5) = 0 to hide the column five but I really want to hide a column allowing the user to resize only the columns wich are not hidden. If you position the mouse between 2 colums and there is a hidden colunm between them you can resize it and becomes visible which is not what I want. Any idea will be appreciated.

Is There A Way To Hide Listview Columns?
hey guys I have a listview called report. Is there a way to hide the first column, so thats its there and the program can access it, but just hidden from the user?

Thanks!

Hide Columns In DataGrid
Dear friends,

I have 5 fields in Table Items.I created DataGrid to view the table.
I have 5 cols. as follows.

code,name,uom,desc and stock.

But I don't want to display all the columns.I want to display only
code,name and stock.How to hide other cols, Please help me to do!

DBGrid Hide Columns........
I have a DBGrid with Columns that I require, however I change the RecordSource to the DBGrid on several occasions this is to save hiding three diferent DBGrids.

As you can Imagine there are unused columns showing in the dbgrid which means you have to scrole to see parts of the data.

Is there a way to hide columns on run time?


thx

Hide Columns In Datagrid
Hi! i use a recordset to set datagrid datasource.
as below,



rs.open "select ID,name,Desc from table" 'rs recordset
set dg1.datasource=rs 'datagrid dg1



My problem is how to hide 'ID' field from the datagrid.
I dont want to display that column.

I know there's a property named 'visibleCols' in datagrid.
it gives the number of columns displayed. How can i put it
to use to hide a column. Any other alternative too will be
great!.

thnx
Mur.

Hide The Columns And Rows
Hai gurus
Can I hide some(not all not thru width =0) columns or some rows in the list view?
regards
Rajender G

Visual Basic List View Control To View Network Computers
Hi,

I am working on simple network connect utility and ready with the functinality. But I am stuck at a very important aspect of the GUI where I need a List View Control that will view the computers from the available LAN domains. And will let us select a particular computer on expanding the domain List Item. If not a list view then a treeview rather.

Also will this control let me select a NETWORK COMPUTER ONLY but not shared folders on its individual drives. Only computers has to be selected. Not the nodes (folders) shared at them.

Thanks.

Vinitsankhe.

Select Sheets And Hide Columns
Hi,

I got a workbook with 46 sheets. I need to select (range) sheet 12 to 46 and hide some columns.

This is what I tried, but I wasn't really lucky with that:

Sub HideRows()

Sheets(Array("12":"46")).Select

Columns("K", "W", "AA", "AC", "AD", "AE", "AH", "AS", "AL").EntireColumn.Hidden = True

End Sub

What am I doing wrong?

Thanks in advance

How To Hide Columns And Rows Not Needed?
Hi, i would like to hide the columns and rows that i dont need when the workbook is open.

I was thinking a For loop from B3 - the last column, but how do i find out the last column?

Same goes for the row.

Also what is the command to add a row or column.
Thanks a bunch..

Resolved-How To Hide Columns With MSflexgird
Hello.

I have no problem with setting the visibility of columns for databoundgrid but I have not yet figured how to hide columns in msflex grid. And also can you use wrap text function with msflex gird. Hm. I use msflexgrid because I want each row to have a specific color determined value of a field in the row. That is not possible with databoundgrid at least in VB6. And with msfelx gird I would like to hide some colums and use wrap text function. Any ideas would be apprichiated and if someone has any ideas on costum controls that would be great. I am looking for something that has both functions of msflexgrid and databoundgrid. A freeware control somewhere?

Hide Columns In Excel Sheet
Hi,
 guys, i need help in hiding columns in excel sheet using userform on load. And but when i read data from the excel sheet, it should read from all the columns in excel sheet including from those hidden columns.

If any of you come across, please help me.

Thanks,
 Chandra

Windows File Explorer.. Icon View And List View.
I'm trying to duplicate a function of the explorer.. The folder contents view.

See example of what I mean...
http://www.ibarn.net/fun/files/thumblist.jpg

I can do everything I need using the filelistbox with the sole exception of changing the display style. I don't want a file list, I want a list-view or icon-view. (Preferably both, with the option to switch between them.)

So my question to you fine people is...... what API or component could I find this capacity in? I've looked at all of the components and didn't see anything that looked close, and a search on the subject yeilds hundreds of people trying to emulate the "filemanager" explorer style, but none trying to kick out a normal, boring icon view like this.

Any help would be greatly appreciated.

Thanks.

List View PopUp Prob (lvwIcon View) *Resolved*
Hi all,

I have a listview in large icon view (lvwIcon). I have a popup menu displaying some options when the user right clicks an item that is specific for that item.

My question is this -

I want a different popup menu to show when the user right-clicks on a blank area of the listview which would display general options.

In my testing, whenever a blank area is clicked, the selected item is the first item (if none had been selected) or the current selected item (if one had already been selected).

I currently use the selecteditem.text to determine what pop up menu is to be used.


I guess in theory the code might be something like ;


Code:
If lvwMain.SelectedItem = Nothing then
PopupMenu mnuGeneral
Else
PopupMenu mnuSpecific
End If


Any help would be greatly appreciated.

Cheers

Jack

Allow User To Hide/show Columns In Listview???
Hi,
is there a way to allow users to choose to hide and show columns in a listview? thanks, beth

How Do I Hide Columns In MSFlexGrid. I Am Using FlexGrid Control 6.0
can i know how to do it

 

Edited by - karenstar on 6/14/2004 10:40:46 AM

Hide Sheets/objects, Save, Unhide Sheets/Objects
There was another post about this recently. I have pieced my code together with that and the help doc. here is what I got.


Code:
Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
Dim strCurrentSheet As String
strCurrentSheet = ActiveSheet.Name
With Application
.ScreenUpdating = False
.EnableEvents = False
End With

If Hidden_Elements_Hidden = False Then Call Hidden_Elements_Hide
If SaveAsUI Then ThisWorkbook.SaveAs Application.GetSaveAsFilename Else ThisWorkbook.Save
If Hidden_Elements_Hidden = True Then Call Hidden_Elements_Show
Sheets(strCurrentSheet).Activate

'NOTE THIS LINE
Cancel = True

With Application
.ScreenUpdating = True
.EnableEvents = True
End With
Workbooks(ThisWorkbook.Name).Saved = True

End Sub
This works fine if I manually save the workbook and then manually close it.
Although, if I just goto close the following happens. I get the save changes prompt. After it saves, I get that same prompt again.

Any Ideas?

Edit:
Is there a way to test if the document is closing in the beforesave event?

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