|
SLRGrant wrote: Would you recommend a Treeview then?
Yes!
MSDN is your good friend, there are samples about populating TreeViews.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
i think that u want to display the values entire the "RUN" Key if this correct ,try this code
Registry.LocalMachine.OpenSubKey("SOFTWARE", True).OpenSubKey("Microsoft", True).OpenSubKey("Windows", True).OpenSubKey("CurrentVersion", True).OpenSubKey("run", True).GetValueNames()
the GetValueNames() return the names of all values in key then u can read the value by using the getvalue("ObjectName") method then u can display them in any way u like
Mohamad A. Flefel
mflefel@hotmail.com
+962 79 5963865
C#.net & VB.net Developer
|
|
|
|
|
|
yay, thank you for the help guys, I should be fine from here
---------------------------
If I had a £0.01 for the amount of times I have said to people "USE GOOGLE" I would be richer than Bill Gates.
|
|
|
|
|
I am currently enrolled in a VB class and am completely new to the class and this forum so if you need any additional information please let me know. I hope this question makes sense to someone. lol
My current project requires me to do a summary with a running total of the number of deposits, amount of deposit, number of checks, amount of checks etc.
I am able to get the summary up in a new messagebox but it will only show the last transaction. for instance if I make a deposit, then write a check, the summary will only show the check written and the amount of the check. It will not show the deposit I made or the amount of the deposit. How can I get it to show all of the totals from all of the transactions?
If you need any code I can provide it for you.
Thanks,
Ruby
|
|
|
|
|
You need to show the code. The answer is, pass all the info you want to see, into the messagebox.
Christian Graus - C++ MVP
|
|
|
|
|
ok, here is the code:
Public Class CheckingAccount
Dim Service = "10.00"
Dim enterAmount As Decimal
Dim Balance As Decimal
Dim totalNumOfDeposit As Integer
Dim totalAmtOfDeposits As Decimal
Dim totalChecks As Decimal
Dim totalAmountOfChecks As Decimal
Dim totalAmountOfService As Decimal
Private Sub menTransaction_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menTransaction.Click
With Me
enterAmount = Decimal.Parse(txtAmount.Text)
If butDeposit.Checked = True Then
Balance = Balance + enterAmount
totalNumOfDeposit = totalNumOfDeposit + 1
totalAmtOfDeposits = totalAmtOfDeposits + enterAmount
ElseIf butCheck.Checked = True Then
Balance = Balance - enterAmount
totalChecks = totalChecks + 1
totalAmountOfChecks = totalAmountOfChecks + enterAmount
ElseIf butService.Checked = True Then
Balance = Balance - Service
totalAmountOfService = totalamountOfChecks + Service
End If
Me.txtBalance.Text = Balance.ToString("C")
Me.txtAmount.Clear()
Me.txtAmount.Focus()
End With
End Sub
Private Sub menSummary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menSummary.Click
Dim Service As Decimal = "10.00"
Dim totalNumOfDeposit As Integer
Dim totalAmtOfDeposits As Decimal
Dim totalChecks As Decimal
Dim totalAmountOfChecks As Decimal
Dim totalAmountOfService As Decimal
Dim messageString As String
With Me
If butDeposit.Checked = True Then
totalNumOfDeposit = totalNumOfDeposit + 1
totalAmtOfDeposits = totalAmtOfDeposits + enterAmount
ElseIf butCheck.Checked = True Then
totalChecks = totalChecks + 1
totalAmountOfChecks = totalAmountOfChecks + enterAmount
ElseIf butService.Checked = True Then
totalAmountOfService = totalAmountOfService + Service
End If
messageString = "Total Deposits: " _
& totalNumOfDeposit.ToString() _
& ControlChars.NewLine _
& "Total Amount Of Deposits: " & totalAmtOfDeposits.ToString() _
& ControlChars.NewLine _
& "Total Checks: " & totalChecks.ToString() _
& ControlChars.NewLine _
& "Total Amount of Checks: " & totalAmountOfChecks.ToString() _
& ControlChars.NewLine _
& "Total Amount of Service Charges: " _
& totalAmountOfService.ToString()
MessageBox.Show(messageString, "Checking Account Summary", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End With
End Sub
So, where do you think I've gone wrong?
Thanks for any help you can give me
Ruby
|
|
|
|
|
RubyM wrote: Dim Service As Decimal = "10.00"
Dim totalNumOfDeposit As Integer
Dim totalAmtOfDeposits As Decimal
Dim totalChecks As Decimal
Dim totalAmountOfChecks As Decimal
Dim totalAmountOfService As Decimal
Dim messageString As String
People used to do this in C, because they had to. You should declare variables as you use them.
So you're saying this message box doesn't show all of the messageString ? Does it show the constants you're passing in ?
RubyM wrote: totalAmountOfChecks.ToString()
I don't believe you need to call ToString, it works it out.
Have you stepped through the debugger to see what's happening ?
RubyM wrote: enterAmount = Decimal.Parse(txtAmount.Text)
You should use TryParse, in case invalid chars are entered.
Christian Graus - C++ MVP
|
|
|
|
|
ok, I stepped through the debugger and don't seem to find any problems (then again, I'm am new to this and probably didn't know what to look for)
the message box shows all of the messageString, but somewhere along the line it is not doing the calculations like it should.
If I have the deposit button checked and enter 3 transactions of $50
then click on the "check" button and enter a transaction of $100
then choose the summary option in my menu the summary should look like this:
Total Deposits: 3
Amount of Deposits: $150
Total checks: 1
Amount of Checks: $100
Total Service charge: $0
but instead it will only show this:
Total Deposits: 0
Amount of Deposits: 0
Total checks: 1
Amount of checks: $100
Total Service charge: $0
I also tried it without the ToString() call and I get "0" for everything in my summary, so I do need the ToString() call.
So that's my problem. It's not holding all of the transactions like it should so I can display them in my summary.
Ruby
|
|
|
|
|
OK, I see now. You initially said 'I'm not seeing them'.
Private Sub menSummary_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles menSummary.Click
Dim Service As Decimal = "10.00"
Dim totalNumOfDeposit As Integer
Dim totalAmtOfDeposits As Decimal
Dim totalChecks As Decimal
Dim totalAmountOfChecks As Decimal
Dim totalAmountOfService As Decimal
Dim messageString As String
These are local variables. If you declare them outside of any method, then they will be member variables, which means they will keep their values between calls to this function.
Christian Graus - C++ MVP
|
|
|
|
|
Got it!! Thanks so much for your help!! It works great now.
Ruby
|
|
|
|
|
Hi, I am new to VB.Net. I am working on a program that needs to solve several one-variable nonlinear equations. For example, I have to solve f(x) = 0, where
f(x) = c0 + c1*x + c2*x^2 + c3*x^3 + c4*x^4 - A
c0, c1, ... c4 and A are constants. When given c0, c1, ..., c4 and A, the program should have the ability to solve f(x) = 0, and give back the value of x.
At first, I try to use try-and-error process to find the roots of the equation, but it failed. I searched online to find if any codes are related to this subject. Unfortunately, I found nothing. So I ask for help here.
If anyone can provide a useful algorithm for my question, it will be much appreciated. Thanks a lot for your help.;)
I am using VB.Net 2003.
+------------------------+
VB.Net, just beginning...
|
|
|
|
|
Some code that I believe would be similar to the example you gave would be:
<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
const double c0=0,c1=1,c2=2,c3=3,c4=4, A=1;<br />
double rval=0;
double toEval=Convert.ToDouble(this.numericUpDown1.Value);
<br />
rval=c0+c1*toEval+c2*(Math.Pow(toEval,2))+c3*(Math.Pow(toEval,3))+c4*(Math.Pow(toEval,4))-A;<br />
<br />
MessageBox.Show(rval.ToString());<br />
}<br />
The code may be slightly different to accomodate the different values of all the const variables. The numericUpDown1 is a control i put on the form just to quickly select the different numbers. Basically just follow your order of operations and look into the functions of the System.Math class.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
|
im creating a report using data report connection with data environment. please any body tll me how can i get the parent-child record by passing a query
|
|
|
|
|
in my project the form background color was not changed i have write the code to change the back color at run time but that code will not working what i have to do?
|
|
|
|
|
Post some code to see where you may have gone wrong.
|
|
|
|
|
Based on your varied questions in multiple forums in 1-2 days it appears you are looking for homework answers.
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
|
|
|
|
|
|
Write a routine to Emit the IL that changes the back color property.
Do your homework yourself, or you'll get more replies like that one. How do you think you will learn anything if you ask others to answer your questions for you?
Arthur Dent - "That would explain it. All my life I've had this strange feeling that there's something big and sinister going on in the world."
Slartibartfast - "No. That's perfectly normal paranoia. Everybody in the universe gets that."
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
how to register the vbsdk62.dll
using regsvr32.exe does not work
mermer4u
-- modified at 10:41 Saturday 25th November, 2006
|
|
|
|
|
Then it's not a COM dll.
Christian Graus - C++ MVP
|
|
|
|
|
in my project the form background color was not changed i have write the code to change the back color at run time but that code will not working what i have to do?
|
|
|
|
|
Is this a windows form or a web form?
Can you show us the Page_Load code you are using?
Jonathan Sampson
www.SampsonResume.com
|
|
|
|
|
If you look at his multiple posts in 1-2 days it appears he's looking for homework answers.
____________________________________________________
If at first you don't succeed, skydiving might not be for you.
|
|
|
|