Go Back  Xtreme Visual Basic Talk > Visual Basic .NET (2002/2003/2005/2008, including Express editions) > .NET General > FlexGrid for VB.NET


Reply
 
Thread Tools Display Modes
  #1  
Old 04-03-2012, 12:22 PM
geo1st487's Avatar
geo1st487 geo1st487 is offline
Junior Contributor
 
Join Date: Oct 2002
Posts: 328
Default FlexGrid for VB.NET


Hi! I use the following code in VB6 and i want to migrate to VB.NET but i can't find any FlexGrid component in ToolBar for the following uses. Also dont want use the msflxgrd.ocx for my application. Which .net component replaces the old msflxgrd.ocx component to make the below?
Thanks

Code:
Private Sub Form_Load()
    Dim row As Integer
    
    With GridShortcutKeys
        .ColWidth(0) = 1400
        .ColWidth(1) = 3200
        .RowHeight(0) = 480
        For row = 1 To 7
            .RowHeight(row) = 320
        Next row
        .ColAlignment(0) = 4
        .ColAlignment(1) = 4
        .TextMatrix(0, 0) = "blah blah"
        .TextMatrix(0, 1) = "blah blah"
        .TextMatrix(1, 0) = "Space"
        .TextMatrix(1, 1) = "blah blah"
        .TextMatrix(2, 0) = "S"
        .TextMatrix(2, 1) = "blah blah"
        .TextMatrix(3, 0) = "Z"
        .TextMatrix(3, 1) = "blah blah"
        .TextMatrix(4, 0) = "1"
        .TextMatrix(4, 1) = "blah blah"
        .TextMatrix(5, 0) = "2"
        .TextMatrix(5, 1) = "blah blah"
        .TextMatrix(6, 0) = "3"
        .TextMatrix(6, 1) = "blah blah"
        .TextMatrix(7, 0) = "4 or 0"
        .TextMatrix(7, 1) = "blah blah"
    End With
End Sub
Reply With Quote
  #2  
Old 04-03-2012, 04:27 PM
hDC_0 hDC_0 is offline
Contributor

* Expert *
 
Join Date: Feb 2004
Posts: 540
Default One option for FlexGrid control replacement in VB.Net..

Quote:
i want to migrate to VB.NET but i can't find any FlexGrid component in ToolBar
Where you looking for "Flexgrid"?

Perhaps you may want to look for the DataGridView control?

FlyGuy has done so much with the FlexGrid control under VB6 over the years that neither DataGrid or the DataGridView control can be considered altogether equivalent but it may get you started.

DataGridControl Usage
DataGridView Control Tutorial
Reply With Quote
  #3  
Old 04-16-2012, 03:30 PM
Roger-U Roger-U is offline
Regular
 
Join Date: Apr 2008
Location: Surrey, UK
Posts: 93
Default

I went through this - and there is no simple solution. And the big pain is that Flexgrid used Row,Column and dataView uses Column,Row

anyway i made my own control which Inherited the DataGridView - then i added the .get_TextMatrix and .set_Textmatrix methods, and some others; and some code i did re-write.

Not terribly elegant but it did enable a fairly quick transition. Recoding the .get_ and .set_ methods would have been a sure way of introducing bugs because of having to swop the Row and Column parameters.

I suppose i could have written a one-off bit of code to scan my source files and reformat all those calls.

Sadly DataGridView does not support column spanning - to do that you have to use the Paint event and dio it the hard way
Reply With Quote
  #4  
Old 04-16-2012, 04:22 PM
Gruff's Avatar
Gruff Gruff is offline
Bald Mountain Survivor

Super Moderator
* Expert *
 
Join Date: Aug 2003
Location: Oregon, USA
Posts: 6,367
Default

The ListView control can show a grid like pattern when you set the VIEW property to "Report" or you could look at the DataGridView control though it is a lot more complex than the old msflexgrid or mshflexgrid control.

I imaging there are a lot of third party replacements for the msflexgrid.
Speaking of which. It you are up to it you could roll your own from scratch.
__________________
Burn the land and boil the sea
You can't take the sky from me


~T
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
 
 
-->