|
-
Dec 19th, 2003, 04:55 PM
#1
Thread Starter
Addicted Member
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.
-
Dec 19th, 2003, 05:11 PM
#2
try using Convert.ToDouble() , eg:
VB Code:
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]
-
Dec 19th, 2003, 05:26 PM
#3
Thread Starter
Addicted Member
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.
-
Dec 19th, 2003, 05:41 PM
#4
when declaring frmDeposid , add it as owned by frmMain , then you can access frmMain's controls / data. eg:
VB Code:
'/// when showing frmDeposid ...
Dim frm2 As New frmDeposid()
MyBase.AddOwnedForm(frm2)
frm2.Show()
then when closing frmDeposid , to set the label's text on frmMain ...
VB Code:
Dim fMain As frmMain = DirectCast(Me.Owner , frmMain)
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]
-
Dec 19th, 2003, 06:12 PM
#5
Thread Starter
Addicted Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|