I have a code that splits the design of my form.
But when I add this control programmatically the value of m_splitBar is always nothing.
I want this object not to be nothing because I'm performing some manipulations there like,
(bar.FindForm.Width),
In VB6 the equivalent of this is (bar.parent.Width).
The "parent object" in createSplitBar function is the Main Form. i just passing it.
Can someone lend me a hand? I hope you guys understand. Thanks In Advance =)



Private WithEvents m_splitBar As PictureBox

Public Sub createSplitBar(ByVal name As String, ByVal parent As Object)
m_splitBar = parent.Controls.Add(m_splitBar)
setSplitterProperties(m_splitBar)
m_imp.setSplitterProperties(CType(m_splitBar, Control))
End Sub



ANOTHER CLASS:
Public Sub setSplitterProperties(ByRef bar As System.Windows.Forms.Control) 'dito
bar = New System.Windows.Forms.Control

With bar
'.Width = VB6.TwipsToPixelsX(75)
.Cursor = System.Windows.Forms.Cursors.SizeWE
.Left = VB6.TwipsToPixelsX(VB6.PixelsToTwipsX(bar.FindForm.Width) / 2)
End With
End Sub