Howdy, Stranger!

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

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Newcomer with disappearing ()

LeshheadLeshhead Posts: 2Member
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

  • PavlinIIPavlinII Posts: 404Member
    : 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]


  • LeshheadLeshhead Posts: 2Member
    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.