Results 1 to 5 of 5

Thread: Help Please **RESOLVED**

  1. #1

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134

    Question Help Please **RESOLVED**

    I have declared Money as Double under the Form Designer and want to make an addition but it keeps on telling me that this is an illegal operation.
    Would someone please explain?

    Code:
    Money = lblBalance.Text + txtAmount.Text
    Why does it work for subtracting but not adding ??
    Please help. Thanks!
    Last edited by Rally2000; Dec 19th, 2003 at 07:24 PM.

  2. #2
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    try using Convert.ToDouble() , eg:
    VB Code:
    1. Money = (Convert.ToDouble(lblBalance.Text) + Convert.ToDouble(txtAmount.Text))
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  3. #3

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    Thanks!



    I have another question!
    There is a label “lblBalance” on frmMain that needs to be updated when I close frmDeposid, how would I go about doing that. I have tried different approaches but have failed to get it to work.
    Thank you so much!
    Last edited by Rally2000; Dec 19th, 2003 at 05:33 PM.

  4. #4
    Frenzied Member dynamic_sysop's Avatar
    Join Date
    Jun 2003
    Location
    Ashby, Leicestershire.
    Posts
    1,142
    when declaring frmDeposid , add it as owned by frmMain , then you can access frmMain's controls / data. eg:
    VB Code:
    1. '/// when showing frmDeposid ...
    2. Dim frm2 As New frmDeposid()
    3. MyBase.AddOwnedForm(frm2)
    4. frm2.Show()
    then when closing frmDeposid , to set the label's text on frmMain ...
    VB Code:
    1. Dim fMain As frmMain = DirectCast(Me.Owner , frmMain)
    2. fMain.lblBalance.Text = "your updated stuff"
    ~
    if a post is resolved, please mark it as [Resolved]
    protected string get_Signature(){return Censored;}
    [vbcode][php] please use code tags when posting any code [/php][/vbcode]

  5. #5

    Thread Starter
    Addicted Member Rally2000's Avatar
    Join Date
    Dec 2003
    Location
    Central USA
    Posts
    134
    Thank you!
    All I have to do now is learn to spell Deposit. LOL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width