Results 1 to 18 of 18

Thread: [RESOLVED] Placing an object inside MSFlexgrid

  1. #1

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Resolved [RESOLVED] Placing an object inside MSFlexgrid

    Hi there,

    The title says it all... I want to place an object inside the MSflexgrid... Standard use of MSFlexgrid only allows the use of Text or pictures... do you guys know of a way to overcome that? The object I want o place inside the MSFlexgrid is a progressbar...

    Thanks in advance
    Last edited by Hack; Mar 24th, 2006 at 09:58 AM. Reason: Added green "resolved" checkmark

  2. #2
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Placing an object inside MSFlexgrid

    The MSFlexgrid is not a container for controls, but you can add the progressbar to your Form, then right click your progressBar, and Select "bring to Front", so the progressbar will be visible over the flexgrid.

  3. #3

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Re: Placing an object inside MSFlexgrid

    Exactly what I thought...

    However when I sort the columns The progressbar doesn't move... disrupting the information...

    Another idea was transforming the progressbar into an image and then insert it into the flexgrid... just didn't figured it out how to do it...

    or... linking the progressbar position to the first data row.... ... no idea how to do it either...

    any more ideas?

  4. #4
    PowerPoster
    Join Date
    Oct 2002
    Location
    British Columbia
    Posts
    9,758

    Re: Placing an object inside MSFlexgrid

    What is the purpose of the progressbar? What exactly are you trying to achieve?

  5. #5

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Re: Placing an object inside MSFlexgrid

    What I'm trying to do is insert a progress bar (reflecting a value) in the flexgrid...

    that is: I have a control panel with data and in order for the user to better understand the data, I display a percentage using the progressbar...

    Wich comes to the problem I present: finding a way of placing the progressbar inside the flexgrid (or over if I can link it to a flexgrid cell - so that the sorting can work properly)...

    I hope my english is understandable... if not please present your doubts...

    thanks in advance.

  6. #6

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Re: Placing an object inside MSFlexgrid

    I hate beeing a pain in the *** but I'm getting desperate...

    ... any idea is most welcome...

  7. #7
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Placing an object inside MSFlexgrid

    How about something like the attached:


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

    Re: Placing an object inside MSFlexgrid

    Quote Originally Posted by segrobiur
    ... I have a control panel with data and in order for the user to better understand the data, I display a percentage using the progressbar...
    Just like brucevde I'm puzzled as to why whould you need a progress bar? Is there any calculations of any kind going on or you're loading data? You may simply calculate percentage and display the number with larger font, different forecolor directly in the cell. You may set backcolor for that cell as well so it will stand out ...

  9. #9

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Re: Placing an object inside MSFlexgrid

    Thas is true.. however when it comes to user interface, it's much more easy to read if you have a graphical representation...

  10. #10

  11. #11
    PowerPoster jcis's Avatar
    Join Date
    Jan 2003
    Location
    Argentina
    Posts
    4,430

    Re: Placing an object inside MSFlexgrid

    What about something like this..
    For this example add a Timer to your Form..
    VB Code:
    1. Private Sub Form_Load()
    2.     With MSFlexGrid1
    3.         .FillStyle = flexFillRepeat
    4.         .Row = 1
    5.         .Col = 1
    6.         .RowSel = .Rows - 1
    7.         .ColSel = 1
    8.         .CellFontName = "Wingdings"
    9.         .CellBackColor = RGB(90, 120, 198)
    10.         .CellForeColor = vbBlue
    11.         .FillStyle = flexFillSingle
    12.         .Col = 1
    13.         .ColWidth(1) = 1200
    14.     End With
    15.    
    16.     Timer1.Interval = 100
    17.     Timer1.Enabled = True
    18. End Sub
    19.  
    20. Private Sub Timer1_Timer()
    21. Dim i As Integer
    22. Static Counter As Integer
    23.     With MSFlexGrid1
    24.         .Redraw = False
    25.         For i = 1 To MSFlexGrid1.Rows - 1
    26.             .TextMatrix(i, 1) = String(Counter, Chr(110))
    27.         Next
    28.         .Redraw = True
    29.     End With
    30.     Counter = Counter + 1
    31.     If Counter = 10 Then Counter = 0
    32. End Sub
    This is just an example, you could make the progress yourself according to real progress of something in the real version.
    Last edited by jcis; Mar 22nd, 2006 at 02:16 PM.

  12. #12
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Placing an object inside MSFlexgrid

    I've updated my example so you can sort the rows.


  13. #13

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Re: Placing an object inside MSFlexgrid

    I've seen both your codes and that's not exactly what I intend to do...

    so far I've got this (see picture attached)... which is what I talked in a previous post: I have the progressbar on top of the flexgrid (and the flexgrid empty)..

    The only problem I face is when using the sort option.... as you can easly forsee what will happen is the colums will be sorted and progressbar will stay the same (not acording to the unsorted grid)...

    nevertheless many thanks for the input

    PS: nevermind the text in the picture ... it's Portuguese... or Chinese for most of you guys
    Attached Images Attached Images  

  14. #14
    Oi, fat-rag! bushmobile's Avatar
    Join Date
    Mar 2004
    Location
    on the poop deck
    Posts
    5,592

    Re: Placing an object inside MSFlexgrid

    In that case it's probably best to move the values, not the progress bars (click on the headers to sort, you can also sort via the progressbar value):

    Attached Files Attached Files

  15. #15

    Thread Starter
    Hyperactive Member segrobiur's Avatar
    Join Date
    May 2004
    Location
    Portugal
    Posts
    371

    Re: Placing an object inside MSFlexgrid

    Many thanks....

    that's exactly what I want.... Now I just have to adapt the code to my project....

    Many thanks,

    You RULE

  16. #16

  17. #17
    Member
    Join Date
    Apr 2021
    Posts
    44

    Re: Placing an object inside MSFlexgrid

    Quote Originally Posted by segrobiur View Post
    Many thanks....

    that's exactly what I want.... Now I just have to adapt the code to my project....

    Many thanks,

    You RULE
    Hello friend, please will you still have the right progresbar to the Flexgrid, I was wondering if you could publish it please.

    Thanks

  18. #18
    PowerPoster SamOscarBrown's Avatar
    Join Date
    Aug 2012
    Location
    NC, USA
    Posts
    9,145

    Re: [RESOLVED] Placing an object inside MSFlexgrid

    I doubt OP is still around after 15 years (but MAY be). If you are looking for a good example, simply download the project from Post #14.

    Comprende?
    Sam I am (as well as Confused at times).

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