Originally Posted by Grimfort You just need to cast it to the correct type: Code: Button1.Margin = DirectCast(Button1.Tag, Padding) It is safer to check the type however: Code: If TypeOf Button1.Tag Is Padding Then Button1.Margin = DirectCast(Button1.Tag, Padding) End If Thanks Grimfort, I'll give that a go.
Button1.Margin = DirectCast(Button1.Tag, Padding)
If TypeOf Button1.Tag Is Padding Then Button1.Margin = DirectCast(Button1.Tag, Padding) End If
If debugging is the process of removing bugs, then programming must be the process of putting them in.
Forum Rules