Hello, I am a beginner and I need to make 4 easy programs. Could someone please give me all the coding for the fallowing programs and/or send me the actual program if you do it? It would help greatly and be much appreciated. I must do these by Thursday night. Thank you!
1) Write a program which will allow you to display in a text box, four different fonts, four different font sizes, as well as italic, bold, and underline using check boxes.
2)Write a program which will allow you to enter text into a text box and change all the letters to lower case apart from the first one which should be in upper case. Use ucase$() and lcase$().
3) Write a program which allows you to input your marks for the 5 courses you are taking into 4 text boxes. Each box should have a label with the subject at the top. There should be label box with the label average on top, & a command button for calculating the average & displaying it in the label box.
4) Create a program which allows the user to select from 5 different types of coffee. Using option buttons, the user should then have a choice of making 5 additions to the coffee using check boxes (sugar, milk, chocolate syrup, chocolate granules, & cherry syrup). The program should be able to calculate the price using a command button.
Not to discurrage you but we don't do homework for anybody - we only help solving problem(s) you may've encountered...
Do you have any idea as to where to start yet?
If not you may perhaps paste few textboxes onto your form and start playing with properties such Font, etc directly in the properties window - that may give an idea how to that same thing programmatically.
Come back when you have more specific questions and don't hesitate to ask.
It's just that you original post was a little too much..
Good luck.
Last edited by RhinoBull; Jun 13th, 2007 at 08:37 PM.
Add two checkboxes and one textbox (chkBold, chkUpperCase and Text1 respectively) to your form, then add the following code to your form and start checking and unchecking those checkboxes:
Code:
Option Explicit
Private Sub Form_Load()
chkBold.Caption = "Bold"
chkUpperCase.Caption = "Upper Case"
End Sub
Private Sub chkBold_Click()
Text1.Font.Bold = chkBold.Value
End Sub
Private Sub chkUpperCase_Click()
Text1.Text = IIf(chkUpperCase.Value = vbChecked, UCase(Text1.Text), LCase(Text1.Text))
End Sub
2, 3 and 4 are very basic and you should have some idea of where to start unless you missed most of your classes. Give one of them a try, show us what you have and we'll help with your questions.
Private Sub Command1_Click()
Dim ctl As Control
Dim lngCount as Long
Dim sngTotal As Single
For Each ctl In Me.Controls
If TypeOf ctl Is Textbox Then
lngCount = lngCount + 1
sngTotal = sngTotal + Val(ctl.Text)
End If
Next
Set ctl = Nothing
lblAverage.Caption = Format(sngTotal / lngCount, "0.00")
End Sub
Neither of those worked. Heres what I have...
-5 text boxes named txt1, txt2, txt3, txt4, and txt5
-1 command button named cmd1
-1 label box named lbldisplay
...and I just need the coding for the command button, I tried both of those and got errors. Thanks by the way for helping me with this.
Last edited by darthmunky; Jun 14th, 2007 at 02:23 PM.
Yes, I did change the names so they match. It was the error where you can choose to debug or end, and when I chose debug, the whole line was highlighted yellow.
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read. Please Help Us To Save Ana
You're welcome. Now that we've helped you, you can help us by pulling down the Thread Tools menu and clicking the Mark Thread Resolved button which will let everyone know that you have your answer.