I have two dtpicker. here I want I select two date from dtpicker and the total sum of amount will show in two diffrent textbox. like: I have two field, expense and income. the total amount of expenses will show in a textbox by selected date and other textbox show income. how I do it?

I have two dtpicker. here I want I select two date from dtpicker and the total sum of amount will show in two diffrent textbox. like: I have two field, expense and income. the total amount of expenses will show in a textbox by selected date and other textbox show income. how I do it?

Hello Abu Taher,

To view calculated values in textBox, you'd need to know the name of the textBox <from it's property>, and then in your code, assign values to it's text property. Try to substitute your values with my sample code snippet below:

myFirstTextBoxName.Text = "Sum of " & valueA & " and " _
                                       & valueB & " is: "
mySecondTextBoxName.Text = totalValue

Hope this helped out.

plz modify this and help me.

Hi Abu,

You marked your thread as solved, yet, you still indicated what was sent should be explained better... hmm....
o.k

You said you have two "dtpicker". What I posted earlier would place values from your calculation into the textboxes...

On the right hand side of your visual basic environment, you have panels such as "Solution Explorer and Properties". When you click on a control <such as TextBox>, the property of that control would be viewable;

(Optionally) change the Name property to any name you want <say abuTaherTextBox1 and abuTaherTextBox2>;

In your code, you can now find the values of you dtpicker and assign them to the TextBoxes as shown below;

abuTaherTextBox1.Text = "Sum of my values: "
abuTaherTexBox2.Text = sumOfValues

<sumOfValues would already have been calculated...>

Hope it's modified enough now...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.