Option Strict was off in my VB app so I have now turned it on. I now have some errors that I am unsure on how to fix:
pnlWait.Top = (Height - pnlWait.Height) / 2
In C# I would just do:
pnlWait.Top = (int)(Height - pnlWait.Height) / 2;
But this doesn't work in VB. I tried Decimal.ToInt32
but then it complains because it is creating a Double
with the division and there is no Double.ToInt32
. Interger.Parse
requires a String
, so this can't be any good.
pnlWait.Top = Integer.Parse(((Height - pnlWait.Height) / 2).ToString) 'Yeah, right!
That makes me think CType
or DirectCast
may be good, but these methods work on many objects so I don't think they could be efficient.
pnlWait.Top = Convert.ToInt32((Me.Height - pnlWait.Height) / 2)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With