Click here to Skip to main content
11,577,240 members (60,047 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# VB.NET
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?
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 6-Jul-13 10:04am

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

  Print Answers RSS
0 DamithSL 155
1 Afzaal Ahmad Zeeshan 125
2 OriginalGriff 115
3 Richard MacCutchan 100
4 Abhinav S 90
0 OriginalGriff 820
1 Sergey Alexandrovich Kryukov 676
2 Abhinav S 528
3 F-ES Sitecore 420
4 Suvendu Shekhar Giri 375


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 6 Jul 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100