Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27554

VS 2012 [RESOLVED] Cloning a columnheader

$
0
0
How can I clone a ColumnHeader object?

Here is the code:

Code:

        Dim ColumnHeaderToClone As New ColumnHeader
        ColumnHeaderToClone.Name = "Test"
        ColumnHeaderToClone.Text = "TestText"
        Dim ClonedColumnHeader As New ColumnHeader
        ClonedColumnHeader = ColumnHeaderToClone.Clone

Here is the error:
Quote:

Option Strict On disallows implicit conversions from 'Object' to 'System.Windows.Forms.ColumnHeader'.
It is possible to clone a ColumnHeader object?

I am trying to use this code, with no luck (I am not sure if this is even possible):

Code:

DirectCast(ColumnHeaderToClone("System.Windows.Forms.ColumnHeader()"), ColumnHeader())
May I please have some help?

Viewing all articles
Browse latest Browse all 27554

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>