Wednesday, June 25, 2008 3:30 PM
Please bear with me here. I have a two part Question.
I have a Windows Forms application, where on one of the forms I have a TableLayoutPanel ( tlp1 )
tlp1 has 96 Columns and only 1 Row.
Question 1: is, IF tlp1 Background set to Transparent, is there
any way to get each of the columns ( one at a time ) to change colour ( LIMEGREEN ) as the mouse
moves over them? Then change back to Transparent as the mouse moves off to the next cell?
Question 2: If Q 1 can be done, Can someone give me an example in code?
Thank you in advance
Wednesday, June 25, 2008 5:02 PM
I don't think you can change the backcolor of the cells of a table layout panel. What you can do is add a panel to each cell and then change the backcolor of it. Try something like this.Code Snippet
Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Hope this helps.
Wednesday, June 25, 2008 5:05 PM
Why are all my b's been turned into ******? Oh, well, change all those ***** to b.
Thursday, June 26, 2008 5:54 PM
I was beginning to think that was me! I'm glad someone else sees that too!
Thursday, June 26, 2008 9:04 PM
You could create a customised tablelayoutpanel as follows and use it instead of the standard one:
Public Sub New()
DoubleBuffered = True
Protected Overrides Sub OnCellPaint(ByVal e As System.Windows.Forms.TableLayoutCellPaintEventArgs)
If e.CellBounds.Contains(PointToClient(Cursor.Position)) Then
Private Sub myTLP_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove