Solved

how to make a col invisible in msflexgrid control at run time

Posted on 2001-09-17
9
212 Views
Last Modified: 2007-12-19
hi
 i have taken a msflexgrid control and i assigned 9 cols to it at design time but at run time i want to make col 6 invisible. i tried but not got thru.
navin
0
Comment
Question by:janikhel
  • 3
  • 2
  • 2
  • +1
9 Comments
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6486851
u cant make it that way.
U can do it the other way.
Make 3 cols only and when u need 9 make it 9

I will send my code

just copy and paste
'first procedure make it 3 cols if u want
Call InitializeGrid(fgridfee, 4, 10, "No", "Name", "Frequency", "Amount", "FromDate", "LastDate", "Fine", "FineAmount", "Month", "Total")

'make size o0f all the cells
Call SetCellSize(fgridfee, 350, 1800, 1100, 800, 1200, 1200, 500, 1000, 1000, 1000)

Public Sub InitializeGrid(grd As MSFlexGrid, nrows As Integer, ncols As Integer, ParamArray colnames() As Variant)
''To Initialize Flex Grid
Dim i As Integer
With grd
    .Rows = nrows
    .Cols = ncols
    .FixedCols = 0
    .Row = 0
    For i = 0 To UBound(colnames)
    .Col = i
    .Text = colnames(i)
    Next i
End With
End Sub
'this procedure has to be used after InitilizeGrid function
Public Sub SetCellSize(grd As MSFlexGrid, ParamArray size() As Variant)
Dim colcount As Integer
Dim i As Integer
colcount = grd.Cols
With grd
    For i = 0 To UBound(size)
    .Col = i
    .ColWidth(i) = CInt(size(i))
    Next i
End With

End Sub
0
 
LVL 1

Expert Comment

by:harsh008_k
ID: 6486861
a)Thatz is just a sample
for ur requirement

1)                          
Call InitializeGrid(fgridfee, 4, 3, "No", "Name","age" )

'make size 0f all the cells
Call SetCellSize(fgridfee, 350, 1800,1000)

'if u want to change the number of columns then

2)use grid's clear function to clear it.
3)reinitialize by calling the same method
'make 9 cols selecting the 3rd parameter to 9
'call setcellsize for those 9  cols

Call InitializeGrid(fgridfee, 4, 9, "No", "Name", "age", "Amount", "FromDate", "LastDate", "Fine",
"FineAmount", "Month")

'make size o0f all the cells
Call SetCellSize(fgridfee, 350, 1800, 1100, 800, 1200, 1200, 500, 1000)



'this should solve ur problem
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6486922
Simply set colWidth to 1

grid.ColWidth(6)=1
0
 

Accepted Solution

by:
Zorxx earned 50 total points
ID: 6486943
What I always use is setting the width of the col to 0.. If you want to show the col then set its width back.
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 3

Expert Comment

by:Bahnass
ID: 6488884
Hi Zorxx
U R right as I said !!!!
0
 

Expert Comment

by:Zorxx
ID: 6489512
Sorry Bahnas, I didn't read your answer
0
 
LVL 3

Expert Comment

by:Bahnass
ID: 6491214
The Asker

Questions  
Questions Asked 7
Last 10 Grades Given  
Question Grading Record 0 Answers Graded / 0 Answers Received
Answers  
Questions Answered 2
Last 10 Grades Received A A  


Zorxx  Do not be so sorry  the asker will decide about points soon !!!!!!  nice 2 meet U



1 09/18/01 50 how to fix a position of a control like textbox in... UnlockedQ
2 09/17/01 50 how to make a col invisible in msflexgrid control ... LockedQ
3 09/08/01 50 how to edit a cell in msflexgrid control UnlockedQ
4 09/06/01 50 How to edit a unbound column in a datagrid control UnlockedQ
Active Server Pages (ASP)
# Date Pts Title Type
5 05/30/01 50 To fill one dropdownlist on selection of another d... UnlockedQ
PHP
# Date Pts Title Type
6 07/30/01 20 how to connect mssql server using php UnlockedQ
XML
# Date Pts Title Type
7 08/01/01 80 How to use web service  UnlockedQ


0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6697150
If this proposed answer has helped you, please accept it, grade it and close this question.  If it did not, reject it and add comments as to your progress and what else is needed.  If no action is taken here by next week, we'll need to decide this outcome.  Expert input always welcome as well.

Thanks,
Moondancer
Community Support Moderator @ Experts Exchange
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 6954651
Finalized today be EE Moderator.
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

744 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

10 Experts available now in Live!

Get 1:1 Help Now