MSFlexGrid Usage in VB5..

1. Is it possible to input data in MSFlexGrid cell ?

2. How can I select all cells in MSFlexGrid with code ?
   - Is there any property, method or event which I can use
     for selecting all cells  ?
   
LVL 1
can9999Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

zsiCommented:
can9999,

You cannot input data directly into an MSFlex grid.  You can, however, overlay a textbox on top of the cell that you want to edit and make it appear as if you are editing directly into the grid.  This technique will also work for comboboxes in a cell.

As for selecting all of the cells, try this:

With MSFlexGrid
   .Row = 0
   .Col = 0
   .RowSel = .Rows
   .ColSel = .Cols
End With

This should work, although I haven't tried it.  I seem to be having a problem with the control license. I will have to re-install my control, but I wanted to get an answer to you quickly.  If it didn't work, tell me and I will try it again.  I will have the control re-installed by then.  :)

Hope this helps!
zsi
0
can9999Author Commented:
Your answer did not work !

At first, please try it yourself !

Thank you ..

0
zsiCommented:
can9999,

That was out of the help file.  The one that comes with the FlexGrid control.  There is a help file that comes with the control.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

clifABBCommented:
The reason why your code to select all cells didn't work is that the last row/col is Rows-1/Cols-1 so your code should read:
  With MSFlexGrid1
   .Row = 0
   .Col = 0
   .RowSel = .Rows - 1
   .ColSel = .Cols - 1
End With

As far as inputting data (which I assume you mean you want to type data from the keyboard).

1. Place a Textbox on the form.  Set it's visible property to false.  Set it's BorderStyle to 0-None.
2. In the EnterCell event of the Flex Grid, Place the following code:
Private Sub MSFlexGrid1_EnterCell()

  With MSFlexGrid1
    Text1.Move .Left + .CellLeft, .Top + .CellTop, .CellWidth, .CellHeight
    Text1.Visible = True
  End With
End Sub

This will get you going.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
zsiCommented:
clifABB,

Thanks for helping with that.  I keep getting an error message when I try to use the control at design time ("License Information for this component not found."), so I was unable to test the code.  Obviously, if MS could get their installation programs to work properly, I would have been able to catch that.

As it is, I had to uninstall VB5 and re-install it as the administrator of my machine (as per MS' direction for NT installations).  It still didn't work, so now I have to RegClean the machine which, in all probability, will render the entire machine useless.

zsi
0
clifABBCommented:
"License Information for this component not found."

You know, I'd like to know what causes that.  It's happened to me on occasion and, although reinstalling fixes it for me, it still happens once in a while.  Even more frustrating, it's not always the same control.
0
zsiCommented:
clifABB,

Check out MSDN Q155059.  It is the closest thing to an answer that I have found.

Unfortunately, it doesn't work.
0
clifABBCommented:
That's all well and good, but it refers to C++ on an NT machine.  I haven't installed C++ *and* I'm running Win95.

I suppose it comes down to a corrupt registry.  But what causes the corruption?
0
can9999Author Commented:
"License Information for this component not found."

Do you know this ?

The serect of "tools\controls\Vbctrls.reg" In vb5 CD,

Dbclick that file and copy all files that placed that dir to "\windows\system"
, and the message will be disappeared.

And Thank You...


0
zsiCommented:
can9999,

You rejected my answer by saying "it didn't work" without stating  what the error was with the code example (invalid property value).

Had you given me, the person answering the question, a chance to correct the answer, you would not have assigned the credit for the answer to the wrong person.  

Rest assured that, in the future, I will give more careful consideration before answering your questions.
0
zsiCommented:
Oh, and the registry file that you referred to does not work.
0
can9999Author Commented:
Well...

I'd solved the same problem. (Threed32.ocx).

I'm sorry.

0
zsiCommented:
Because I am such a nice guy, I am posting this solution here..  :)

==================================================
FILE: Vbc.exe Fixes VB 5.0 Control Installation Problem

     Last reviewed: March 13, 1998
     Article ID: Q181854
     The information in this article applies to:

          Microsoft Visual Basic Control Creation, Learning, Professional, and Enterprise Editions for Windows, version 5.0

     SUMMARY

     Vbc.exe installs the Vbcmpfix.exe utility, that fixes problems with the following three symptoms:

     Symptom I

     When trying to site a control within your project, you receive the following error message:

        License Information For This Component Not Found.  You Do Not Have An
        Appropriate License To Use This Functionality In The Design Environment.


     Symptom II

     When trying to compile your project, you receive the following error:

        Compile Error : Permission Denied


     Symptom III

     When trying to run your project, you receive the following error:

        Runtime Error '429' : ActiveX Component Can't Create Object


     MORE INFORMATION

     The following file is available for download from the Microsoft Software Library:

      ~ Vbc.exe (size: 36208 bytes)

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.