Click here to Skip to main content
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 11:04am

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 295
1 OriginalGriff 274
2 Shweta N Mishra 216
3 PIEBALDconsult 184
4 CPallini 155
0 OriginalGriff 7,630
1 Sergey Alexandrovich Kryukov 7,022
2 DamithSL 5,586
3 Manas Bhardwaj 4,946
4 Maciej Los 4,525


Advertise | Privacy | Mobile
Web02 | 2.8.1411023.1 | Last Updated 6 Jul 2013
Copyright © CodeProject, 1999-2014
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