Click here to Skip to main content
15,898,010 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hi Everyone,
I am a little new to this, so I hope what I post is readable, and easy to understand. I was trying to work with the tableLayoutPanel in Visual Studio and I noticed here http://msdn.microsoft.com/en-us/library/ms171689(v=vs.80).aspx[^] that the tableLayout panel doesn't support visual inheritance. I notice when I call the Invalidate method from a derived class that it works when I set a breakpoint, but otherwise, the CellPaint() method doesn't seem to work. I also try calling the method directly as you can see below. I don't get any compile errors. What do you think might be the best way around this? Threading maybe?
VB
Sub Evaluator()
       Dim Input As Int16
       Dim o As Windows.Forms.TableLayoutCellPaintEventArgs
       'Dim caller as Form1.PanelPanter(AddressOf Form1.TableLayoutPanel1_CellPaint)
       'The following just needs to be explored here:  http://msdn.microsoft.com/en-us/library/vstudio/system.windows.forms.painteventargs(v=vs.100).aspx
       Input = Assigner(Form1.i)
       Dim g As Graphics
       g = Form1.Panel1.CreateGraphics
       Dim Rectang As Rectangle
       Dim Tangrec As Rectangle
       Dim Coller As Integer
       Dim Rower As Integer
       o = New Windows.Forms.TableLayoutCellPaintEventArgs(g, Rectang, Tangrec, _
       Coller, Rower)
       If -1 < Divy And Divy < Form1.i Then
           Form1.Div = Input
           Form1.TextBox3.Clear()
           AdjustTable()
           'Trying to Invalidate
           Form1.Panel1.Invalidate(True)
           'Trying to call CellPaint() directly
           Form1.TableLayoutPanel1_CellPaint(Me, o)
       ElseIf Divy < 0 Then

           'call the code that shows the over use of vacume
       ElseIf Form1.i <= Divy Then
           'call the code showing the overspill of chemicals.
       End If
       If Done = True Then

       End If

   End Sub


Please let me know if I can make anything more clear. Thanks for your help!
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900