CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: MS Grid Control

  1. #1
    Join Date
    Feb 2000
    Posts
    440

    MS Grid Control

    Hi,

    I need to set picture in every cell of grid control with more than 200 cells by 200 rows.

    However this process takes more time that bearable. Can anyone give me a suggestion how to speed this process.

    here is how I do this


    Grid.Redraw = false
    Dim j as Integer
    Dim i as Integer
    for j = 0 to Grid.Cols - 1
    for i = 0 to Grid.Rows - 1
    Grid.Row = i
    Grid.Col = j
    Grid.CellPictureAlignment = flexAlignCenterCenter
    set Grid.CellPicture = LoadResPicture(104, vbResIcon)
    next
    next
    Grid.Redraw = true







    Thanks

    Valery Iskarov Nikolov
    Software Dynamics

  2. #2
    Join Date
    Jul 2001
    Location
    Trivandrum, Kerala, India
    Posts
    21

    Re: MS Grid Control

    Hai,

    As you are loading the same picture to all cells, why do you load the picture every time? The following code will run more efficiently


    Dim X as IPictureDisp

    Grid.Redraw = false
    Dim j as Integer
    Dim i as Integer

    set X = LoadResPicture(104, vbResIcon)

    for j = 0 to Grid.Cols - 1
    for i = 0 to Grid.Rows - 1
    With Grid
    .Row = i
    .Col = j
    .CellPictureAlignment = flexAlignCenterCenter
    set .CellPicture = X
    End With
    next
    next
    Grid.Redraw = true




    All the best.

    Kishore



  3. #3
    Join Date
    Feb 2000
    Posts
    440

    Re: MS Grid Control

    thanks, you are right

    Valery Iskarov Nikolov
    Software Dynamics

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

Featured