Solved

MSFlexGrid Usage in VB5..

Posted on 1998-05-21
13
340 Views
Last Modified: 2008-02-01
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  ?
   
0
Comment
Question by:can9999
  • 7
  • 3
  • 3
13 Comments
 
LVL 4

Expert Comment

by:zsi
ID: 1456438
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
 
LVL 1

Author Comment

by:can9999
ID: 1456439
Your answer did not work !

At first, please try it yourself !

Thank you ..

0
 
LVL 4

Expert Comment

by:zsi
ID: 1456440
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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 6

Accepted Solution

by:
clifABB earned 50 total points
ID: 1456441
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
 
LVL 4

Expert Comment

by:zsi
ID: 1456442
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
 
LVL 6

Expert Comment

by:clifABB
ID: 1456443
"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
 
LVL 4

Expert Comment

by:zsi
ID: 1456444
clifABB,

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

Unfortunately, it doesn't work.
0
 
LVL 6

Expert Comment

by:clifABB
ID: 1456445
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
 
LVL 1

Author Comment

by:can9999
ID: 1456446
"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
 
LVL 4

Expert Comment

by:zsi
ID: 1456447
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
 
LVL 4

Expert Comment

by:zsi
ID: 1456448
Oh, and the registry file that you referred to does not work.
0
 
LVL 1

Author Comment

by:can9999
ID: 1456449
Well...

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

I'm sorry.

0
 
LVL 4

Expert Comment

by:zsi
ID: 1456450
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

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

821 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