Newcomer with disappearing ()

I'm having an odd issue as I try to learn VB.Net out of a book. I'm using Visual Studio .Net 2003, but I have Visual Basic 2005 Express Edition installed as well. It tells me to put this code in:

Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
Dim frmOutput As New Output()
fromOutput.ShowDialog()


Me.BackColor = Color.FromKnownColor(CInt(Int(150 * Rnd()) + 1))

after the part that says Windows Form Designer generated code. There is a second form called Output that has a label thingy with some text in it. For some reason, every time I type this in, the parenthesis after As New Output disappears and I get an error compiling. Can someone help me figure this out?

Comments

  • : I'm having an odd issue as I try to learn VB.Net out of a book. I'm using Visual Studio .Net 2003, but I have Visual Basic 2005 Express Edition installed as well. It tells me to put this code in:
    :
    : Private Sub Form1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Click
    : Dim frmOutput As New Output()
    : fromOutput.ShowDialog()
    :
    :
    : Me.BackColor = Color.FromKnownColor(CInt(Int(150 * Rnd()) + 1))
    :
    : after the part that says Windows Form Designer generated code. There is a second form called Output that has a label thingy with some text in it. For some reason, every time I type this in, the parenthesis after As New Output disappears and I get an error compiling. Can someone help me figure this out?
    :

    Hi,
    are you 100% percent sure that there exist (in code of your second form) another class with
    [code]Public Class Output[/code]
    at it's beggining?

    But
    Color.FromKnownColor(CInt(Int(150 * Rnd()) + 1))
    is quite a strange line of code .. FromKnownColor expects parameter of type System.Drawing.KnownColor, not integer..

    What error do you exactly recieve?

    [blue][b][italic][size=4]P[/size]avlin [size=4]II[/italic][/size][/b][/blue]

    [purple]Don't take life too seriously anyway you won't escape alive from it![/purple]


  • Hey, thank you for trying to help, I figured it out, and I just realized someone had replied. Thank you anyway.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories