Results 1 to 14 of 14

Thread: MSflexgrid question

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    MSflexgrid question

    Hi,

    How can i export the contents of a MSflexgrid to a richtextbox?
    Please advise.

    Many Thanks

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: MSflexgrid question

    Would this work for you?
    Code:
    Private Sub Command12_Click()
    
        With MSHFlexGrid1
            .Col = 0
            .Row = 0
            .ColSel = .Cols - 1
            .RowSel = .Rows - 1
            Clipboard.Clear
            Clipboard.SetText .Clip, vbCFRTF
            .ColSel = 0
            .RowSel = 0
        End With
        
        RichTextBox1.TextRTF = Clipboard.GetText(vbCFRTF)
    
    End Sub

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    Re: MSflexgrid question

    Hi Mate,

    Thanks for reply,

    unfortunately that did not work. The richtextbox remained blank

  4. #4
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: MSflexgrid question

    I think that the Clip property is only available for the MSHFlexGrid.

  5. #5

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    Re: MSflexgrid question

    just had a look for the MSHflexgrid control within Project - Components and cannot find it. I have VB6 which is fully updated.

  6. #6
    Frenzied Member
    Join Date
    Aug 2006
    Location
    India, Punjab, Bhatinda
    Posts
    1,689

    Re: MSflexgrid question

    The name to look for is Microsoft Hierarchial FlexGrid Control 6.0 (SP4) the ocx name is MSHFLXGD.OCX

  7. #7

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    Re: MSflexgrid question

    found it, thanks.

    However, i am using a DOA data control which is not valid for a MSHflexgrid.

    so i'm still looking for a solution to my original question

    thanks

  8. #8
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: MSflexgrid question

    I'm guessing you meant DAO data control.

    I think if you moved to the new technology of ADO, you would have better results.

  9. #9

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    Re: MSflexgrid question

    Hi Hack,

    yes i mean DAO. The program was written several years ago, when DAO was all the rage. If i was to do the program again now, i would definately use ADO. I am not a programmer by trade and the program was something i wrote to make my life a bit easier in my Job. I havent got the time to redo it. Anyway, it works perfectly fine as is.

    Any help with my current problem will be most appreciated.

  10. #10
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: MSflexgrid question

    Quote Originally Posted by Joacim Andersson
    I think that the Clip property is only available for the MSHFlexGrid.
    No, it is avalable for either flexgrid - incidentally at the time of posting I was doing something with the hierarchical grid so it came handy.

  11. #11
    Frenzied Member aikidokid's Avatar
    Join Date
    Aug 2002
    Location
    Bristol, UK
    Posts
    1,968

    Re: MSflexgrid question

    How about adding the contents of the MSFlexgrid to a text file and then adding that to the RichTextBox
    If somebody helps you, take time to RATE the post. I do.

    "FAILURE IS NOT AN OPTION. It comes bundled with the software."

    Below are some of the threads that have helped me along the way:

    CodeBank submission:
    Listview Backcolor (without subclassing)

    Loading Treeview Nodes From A Database, Creating Registry Keys, Count Number of Lines in TextBox , Excellent RichTextBox Tricks & Tips
    Ideas & Screen Shots For A Code Library App
    How to do Data validation in Excel, Conditional Formating in Excel

  12. #12
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649

    Re: MSflexgrid question

    Quote Originally Posted by RhinoBull
    No, it is avalable for either flexgrid
    Yeah you're right (however MSDN Library states differently). I also just tried the code you posted and it works just fine for me.

  13. #13

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    Re: MSflexgrid question

    I'll have another look at my code and try and find the reason the data is not exporting.

    I have 5 columns on my MSflexgrid.

  14. #14

    Thread Starter
    Addicted Member
    Join Date
    Nov 2001
    Location
    ottawa, canada
    Posts
    233

    **RESOLVED** MSflexgrid question

    Hi,

    all is working now. Thanks for all your help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width