sm321
2012-02-03 03:12:21
2012-02-03 03:12:21
2012-02-03 03:24:03
From: sm321
I am looking to make a .exe file which opens in a GUI. But I don't know how to do it. I want it to have functions e.g. type a number in a box. Thanks :)
2012-02-03 03:42:19
2012-02-03 03:43:02
2012-02-03 03:48:05
From: shadowmarkus
Are you sure you mean an exe? Don't you mean a form in Simba? That's alot simpler doing than making a program itself.
2012-02-03 03:58:13
2012-02-03 04:02:34
From: sm321
Sorry, I should have put that, I've heard visual basic is easy for a beginner? I've got Windows OS.
2012-02-03 04:05:01
From: ShawnjohnSJ
Yes its very easy for beginners and its built for the Windows OS. Just download Visual Basic Express and watch this 6 minute video on how to create a simple calculator.
http://www.youtube.com/watch?v=K2vqJxvg6JM
2012-02-03 04:12:18
From: Wizzup?
It may be easy for beginners, but if you begin with stuff like that you'll most of the time never get much further than a beginner… No offense intended.
From: ShawnjohnSJ
Yes its very easy for beginners and its built for the Windows OS. Just download Visual Basic Express and watch this 6 minute video on how to create a simple calculator.
http://www.youtube.com/watch?v=K2vqJxvg6JM
2012-02-03 04:13:28
From: Wizzup?
It may be easy for beginners, but if you begin with stuff like that you'll most of the time never get much further than a beginner… No offense intended.
I have Windows XP 2003, is that a problem?
2012-02-03 04:18:26
From: ShawnjohnSJ
There are many different programming languages that can create a executable file. There are probably too many for me to list but I'll list the ones that I know of off the top of my head:
C
C++
Delphi
Visual Basic
C#
To get started with GUI's, the easiest would be Visual Basic by Microsoft.
http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-basic-express
2012-02-03 04:19:09
From: sm321
It says that type of file can harm my computer?
2012-02-03 04:20:00
From: ShawnjohnSJ
When you download the executable for Visual Basic Express 2010?
2012-02-03 04:21:35
From: sm321
Yes the link you gave me. Also, it says I need 3GB of space left, is that how much it takes up?
2012-02-03 04:22:41
From: ShawnjohnSJ
That's just telling you that .exe files are potentially dangerous.
From: ShawnjohnSJ
That file is from Microsoft's website so you don't have anything to worry about. Yes it takes up 3GB of space.
2012-02-03 04:25:16
From: sm321
That's ok then :)
Could it be saved to an external hard drive?
2012-02-03 04:28:52
2012-02-03 12:32:43
2012-02-03 12:34:02
From: ShawnjohnSJ
I can't help you without seeing your code. If possible, use thebrackets and post your code.
2012-02-03 12:35:20
From: sm321
I think I know how to fix it. I think it needs an equals button.
2012-02-03 12:37:14
From: ShawnjohnSJ
Yeah that makes sense. :p
2012-02-03 12:41:54
2012-02-03 12:43:37
From: ShawnjohnSJ
Are you putting in 5 and 6 before you press the + button? That looks like the only way you can do it with the way its coded.
2012-02-03 12:45:01
From: sm321
It worked properly if I put the two numbers in then click +. I'm only practising anyway :)
2012-02-03 12:47:31
From: ShawnjohnSJ
Yes the way its coded thats the only way to do it.. however you can code it a different way once you get better. (You can look for more tutorials on youtube or Google for creating a better calculator).
2012-02-03 12:49:53
From: sm321
I've made an equals button which has made the calculator work, but I've only made work for +. How do I make it work for all 4 +-*/
2012-02-03 12:51:39
From: ShawnjohnSJ
That depends on how you coded the function for the equals button. Let me see the code.
2012-02-03 12:54:03
From: sm321
Label2.Text = "+"
Label1.Text = Val(TextBox1.Text) + Val(TextBox2.Text)
I just copied and pasted the + button's coding :)
2012-02-03 13:03:01
From: sm321
I've made an equals button which has made the calculator work, but I've only made work for +. How do I make it work for all 4 +-*/
Dim firstValue as Double
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "-"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "+"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "x"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "/"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Label2.Text = "="
Label1.Text = firstValue / Val(TextBox2.Text)
End Sub
2012-02-03 14:35:05
From: ShawnjohnSJ
Well you would have to recode some of your program to make it work for an equals button.. the only reason it works for addition is because you're basically performing the addition twice.
Give me a few minutes and I'll try to write up some code that'll have an equals button.
Edit: Try this code.. I don't know if it works because I don't have visual basic installed but it should work. It will only work for 2 numbers. Make sure your equals button is named "Button5"Dim firstValue as Double
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "-"
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "+"
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "x"
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
firstValue = Val(TextBox1.Text)
Label2.Text = "/"
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
Label2.Text = "="
Label1.Text = firstValue / Val(TextBox2.Text)
End Sub
2012-02-03 14:43:03
From: sm321
Thanks, I'll try that sometime :) But I've encountered another problem, I've got this code:
Val(TextBox2.Text) = Val(TextBox5.Text) - Val(TextBox4.Text) * Val(TextBox6.Text)
Yet it says 'Expression is a value and therefore cannot be the target of an assignment'.
TextBox2.Text = Val(TextBox5.Text) - Val(TextBox4.Text) * Val(TextBox6.Text)
2012-02-03 14:49:32
From: ShawnjohnSJ
TextBox2.Text is a variable. When you do Val(TextBox2.Text) it converts that string into an integer (hence Val=Value).. what you're doing here is setting the integer value of TextBox2.Text to … which doesn't make any sense.
To put that into simpler terms, only use Val after the equals sign.TextBox2.Text = Val(TextBox5.Text) - Val(TextBox4.Text) * Val(TextBox6.Text)
2012-02-03 14:51:20
From: sm321
It hasn't come up with an error, yet text box 2 is still blank :wacko:
2012-02-03 15:09:00
2012-02-03 15:47:51
From: Wizzup?
It may be easy for beginners, but if you begin with stuff like that you'll most of the time never get much further than a beginner… No offense intended.
2012-02-03 17:12:49
From: n3ss3s
Yes, and considering actual VB coding rather than messing with the form designer, it's syntax and ideas are very, very different from the "leading" languages (which future languages are based on).
2012-02-04 05:02:39
From: Wizzup?
It may be easy for beginners, but if you begin with stuff like that you'll most of the time never get much further than a beginner… No offense intended.
2012-02-04 05:27:13
2012-02-04 08:08:04
From: sm321
I've had a little practice with it and want to make a Runescape Calculator of some sort, but what should I make?
2012-02-04 08:32:56
From: Daniel
BASIC was really just designed to teach the use of types, control structures, and the like, in a nice easy manner. I agree that it is good for learning, but disagree to constantly use it for everything.
2012-02-04 10:19:42
From: Daniel
RuneScape calculator?