473,387 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Really stupid question I believe...

JB
So I am beginning to dabble in the express editions that MS is offering
currently. I am trying to write a basic program, but am having issues. Here
is the code so far:

Public Class testprog

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnCalculate.Click
Dim Total, Sum As Integer
For Value As Integer = txtValueStart.Text() To txtValueEnd.Text()
For Modifier As Integer = 20 To 200
Sum = (1.09 ^ Value) * Modifier
If Sum = Total Then
MessageBox.Show(Value & Modifier)
End If
Next Modifier
Next Value
End Sub
End Class

Now this in itself works fine. the problem is, as it cycles through the
loop, the message box will come up for every match it finds (as it should).
My problem/question is I need to find a way to dump the true statements into
preferaby a combo box that the user can than choose from. I am unfamiliar on
how to go about doing this. Can someone point me in the right direction?
Thanks in advance.
Jeremy
Feb 22 '06 #1
3 856
JB
ok that code didn't work at all...this does though:

Public Class testprog

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnCalculate.Click
Dim Total, Sum As Integer
Total = Me.txtTotal.Text()
For Value As Integer = Me.txtValueStart.Text() To
Me.TxtValueEnd.Text()
For Modifier As Integer = 20 To 200
Sum = (1.09 ^ Value) * Modifier
If Sum = Total Then
MessageBox.Show(Value.ToString() & " " &
Modifier.ToString())
End If
Next Modifier
Next Value
End Sub
End Class

now i am not sure how to move the two results to a combobox instead of
outputing in a message box.
Feb 22 '06 #2
mycombox.items.add(......your string here)
--
Dennis in Houston
"JB" wrote:
ok that code didn't work at all...this does though:

Public Class testprog

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnCalculate.Click
Dim Total, Sum As Integer
Total = Me.txtTotal.Text()
For Value As Integer = Me.txtValueStart.Text() To
Me.TxtValueEnd.Text()
For Modifier As Integer = 20 To 200
Sum = (1.09 ^ Value) * Modifier
If Sum = Total Then
MessageBox.Show(Value.ToString() & " " &
Modifier.ToString())
End If
Next Modifier
Next Value
End Sub
End Class

now i am not sure how to move the two results to a combobox instead of
outputing in a message box.

Feb 23 '06 #3
JB
That did it. Thank you much :)

"Dennis" wrote:
mycombox.items.add(......your string here)
--
Dennis in Houston
"JB" wrote:
ok that code didn't work at all...this does though:

Public Class testprog

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BtnCalculate.Click
Dim Total, Sum As Integer
Total = Me.txtTotal.Text()
For Value As Integer = Me.txtValueStart.Text() To
Me.TxtValueEnd.Text()
For Modifier As Integer = 20 To 200
Sum = (1.09 ^ Value) * Modifier
If Sum = Total Then
MessageBox.Show(Value.ToString() & " " &
Modifier.ToString())
End If
Next Modifier
Next Value
End Sub
End Class

now i am not sure how to move the two results to a combobox instead of
outputing in a message box.

Feb 23 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Adam Smith | last post by:
I have posted this and similar questions repeatedly and can't even raise a single response. I am being led to believe that this then 'Must be a stupid question' although people say that there is no...
56
by: infidel | last post by:
Where are they-who-hate-us-for-our-whitespace? Are "they" really that stupid/petty? Are "they" really out there at all? "They" almost sound like a mythical caste of tasteless heathens that "we"...
56
by: tasteless | last post by:
Hi guys, I need really hard questions (about 10) about PHP programming (some of elements OOP as well, but no MySQL questions - this is different part), this questions needs to be very hard, but...
7
by: schoenfeld.one | last post by:
Most people don't know that there were actually 3 buildings which came crashing down on the day of 9/11. The third building, WTC 7, can be seen here ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.