Solved

Editable Flex Grid

Posted on 2004-09-26
6
1,514 Views
Last Modified: 2013-12-26
1) How to make Flex Grid or Data Grid editable in vb6.Do we have any other editable grid control in vb6.
2) how to embed Excel sheet on any VB form.
0
Comment
Question by:deepu712
6 Comments
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12157879
1) flexgrid cannot be editable .. the other grid provided by microsoft is datagrid
2) what do u mean by embed .. do u just want to open and display an excel sheet .. u could look at OLE or reference to Excel objects within ur project and use them to open an excel application and ur workbook
0
 
LVL 26

Expert Comment

by:Rejojohny
ID: 12157918
have a look at this link provided by microsoft .. shows how u could code to make ur flexgrid editable ...
http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/KB/ARTICLES/Q85/1/09.asp&NoWebContent=1

there are also some third party controls like sharpgrid, spread control, VSFlexgrid, shridian controls etc which provide good functionalities .. like the one u require and also adding combos, checkbox within cells etc ..
0
 
LVL 11

Accepted Solution

by:
dbrckovi earned 125 total points
ID: 12163054
FlexGrid is not editable by default, but you can use KeyPress event to make it editable.

For example:

'---------------------------------------------------
Private Sub Form_Load()
    MSFlexGrid1.Rows = 5
    MSFlexGrid1.Cols = 5
End Sub

Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
    With MSFlexGrid1
        Print KeyAscii
   
        If KeyAscii = 8 And Len(.Text) > 0 Then .Text = Left(.Text, Len(.Text) - 1)
       
        If KeyAscii >= 32 And KeyAscii <= 128 Then
            .Text = .Text & Chr(KeyAscii)
        End If
    End With
End Sub
'------------------------------------------------------------
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 11

Expert Comment

by:Steiner
ID: 12190636
Cool thing dbrckovi, I never thought that making a flexgrid editable would be that easy...
0
 
LVL 11

Expert Comment

by:dbrckovi
ID: 12192624
Well yes, it's easy to create basic edit functions, but some things are still not possible as far as I know.

For example, I never managed to create blinking cursor, or find an easy way to edit middle of the text in a cell.

Another possibility would be to do the Excell-style editing. For example, create a textbox next to the flexgrid and keep it updated with the contents of the selected cell.
In textbox's Change event, update the selected cell.

'-------------------------------------

To embed an excell sheet on your form just create WebBrowser control (Project -> Components -> Microsoft Internet Controls)
and use it's Navigate function:

WebBrowser1.Navigate "d:\download\rosenthal.xls"
0
 
LVL 9

Expert Comment

by:dancebert
ID: 12201440
Many developers have written wrappers or templates for flexgrid to make it editable.  This is the one I use.  It's object-oriented and allows input validation on a column-by-column basis.

http://www.a1vbcode.com/app.asp?ID=2281
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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…
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…

708 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

12 Experts available now in Live!

Get 1:1 Help Now