Results 1 to 5 of 5

Thread: How to Repaint client area of a MDI form ? [Resolved]

Threaded View

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Feb 2002
    Location
    Canada, Toronto
    Posts
    5,803

    Question How to Repaint client area of a MDI form ? [Resolved]

    I'm making a multithreaded client server program, and on the server side I have a MDI form where I want to draw on the client area of the form the connection status of all clients.

    I added a picture box in the MDI, with the Visible = False, I paint on the picturebox what I need, then I set the picture's Image to the MDI form Picture (see code).

    The problem is that after I do that, there is no method for MDI do refresh the form !

    I'm using the following code:
    VB Code:
    1. Private Sub CConnection_StateChanged(Index As Integer, ByVal NewSckState As Integer)
    2.     Dim TmpStr As String, K As Long, TextHeight As Single
    3.    
    4.     Debug.Print "CConnection_StateChanged: " & Index, NewSckState
    5.    
    6.     picDrawClientState.Cls
    7.     picDrawClientState.AutoRedraw = True
    8.    
    9.     For K = 0 To CConnection.UBound
    10.         With picDrawClientState
    11.             .CurrentX = 25
    12.             .CurrentY = K * TextHeight + 50
    13.            
    14.             picDrawClientState.Print K
    15.             If K = 0 Then TextHeight = .CurrentY - 50
    16.            
    17.             .CurrentX = 500
    18.             .CurrentY = K * TextHeight + 50
    19.            
    20.             TmpStr = Choose(CConnection(K).ClientState + 1, _
    21.                            "Closed", "Open", "Listening", "Connection pending", _
    22.                            "Resolving host", "Host resolved", "Connecting", _
    23.                            "Connected", "Disconnecting", "Error")
    24.             picDrawClientState.Print TmpStr
    25.            
    26.             picDrawClientState.Line (0, .CurrentY)-(5000, .CurrentY)
    27.         End With
    28.     Next K
    29.    
    30.     picDrawClientState.Line (450, 0)-(450, 10000)
    31.     Set frmMain.Picture = picDrawClientState.Image
    32.    
    33.     ' HAVE TO REDRAW THE MDI HERE !!!
    34. End Sub

    Thanks in advance...
    Last edited by CVMichael; Apr 21st, 2005 at 10:24 AM. Reason: Resolved

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