dcarp757's Profile
Reputation: 0
Apprentice
- Group:
- New Members
- Active Posts:
- 9 (0.03 per day)
- Joined:
- 02-September 12
- Profile Views:
- 193
- Last Active:
Oct 03 2012 05:58 PM- Currently:
- Offline
Previous Fields
- Dream Kudos:
- 0
Posts I've Made
-
In Topic: point to point line draw problem?
Posted 3 Oct 2012
maj3091, on 03 October 2012 - 06:22 AM, said:You might be better contacting a mod to move this to the correct forum as it's not VB6 related and you'll get a better response in the correct forum.
I'm obviously a beginner. This is VB course work out of a VB book (Deitel VB 2008 3rd Ed). What forum do you suggest? -
In Topic: user entered graphics coordinates
Posted 26 Sep 2012
I figured it out. Thanks!
Public Class LogoForm Dim g As Graphics Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click g = logoPicture.CreateGraphics Dim x1 As Integer Dim y1 As Integer Dim x2 As Integer Dim y2 As Integer x1 = CInt(Val(x1TextBox.Text)) y1 = CInt(Val(y1TextBox.Text)) x2 = CInt(Val(x2TextBox.Text)) y2 = CInt(Val(y2TextBox.Text)) Dim p As New Pen(Color.Blue, 2) Dim b As New SolidBrush(Color.Blue) If lineRadioButton.Checked = True Then g.DrawLine(p, x1, y1, x2, y2) ElseIf filledRectangleRadioButton.Checked = True Then g.FillRectangle(b, x1, y1, x2, y2) ElseIf rectangleRadioButton.Checked = True Then g.DrawRectangle(p, x1, y1, x2, y2) ElseIf ellipseRadioButton.Checked = True Then g.DrawEllipse(p, x1, y1, x2, y2) ElseIf filledEllipseRadioButton.Checked = True Then g.FillEllipse(b, x1, y1, x2, y2) End If End Sub -
In Topic: Array help
Posted 4 Sep 2012
-
In Topic: VB Function Procedure help?
Posted 4 Sep 2012
maj3091, on 03 September 2012 - 11:50 PM, said:You have a couple of options.
1. Either make your calculation functions of type String, then cast your calculation to a string before returning. At the moment, you're functions are doubles and you're trying to return a string - I'm guessing that doesn't work??
2. Return a Double type from the current calculation functions and cast it to a string when assigning it to the label.
Thanks for your reply. Changing to string allowed me to output a string. Below is what I have currently. How can I pull the value entered by user into the output string? To clarify. x = user input. y = converted output. "x degrees celsius is equal to y degrees farhenheit" As you can see, as of now I just append a string to y.
Public Class TemperatureConversionForm Private Sub TemperatureConversionForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub convertFahrenheitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertFahrenheitButton.Click outputLabel.Text = Conv2F(Val(degreeTextBox.Text)) End Sub Function Conv2F(ByVal celsius As String) As String Dim fahrenheit As Double fahrenheit = (9 / 5) * celsius + 32 Conv2F = fahrenheit Return String.Format("{0:F}", fahrenheit) & " is fahrenheit equivalent" End Function Private Sub convertCelsiusButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertCelsiusButton.Click outputLabel.Text = Conv2C(Val(degreeTextBox.Text)) End Sub Function Conv2C(ByVal fahrenheit As String) As String Dim celsius As Double celsius = (5 / 9) * (fahrenheit - 32) Conv2C = celsius Return String.Format("{0:F}", celsius) & " is celsius equivalent" End Function End Class ' TemperatureConversionForm -
In Topic: VB Function Procedure help?
Posted 3 Sep 2012
Ok so I figured out the format. How do I add the text string to the output?
Public Class TemperatureConversionForm Private Sub TemperatureConversionForm_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load End Sub Private Sub convertFahrenheitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertFahrenheitButton.Click outputLabel.Text = Conv2F(Val(degreeTextBox.Text)) End Sub Function Conv2F(ByVal celsius As Double) As Double Dim fahrenheit = (9 / 5) * celsius + 32 Return String.Format("{0:F}", fahrenheit) End Function Private Sub convertCelsiusButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles convertCelsiusButton.Click outputLabel.Text = Conv2C(Val(degreeTextBox.Text)) End Sub Function Conv2C(ByVal fahrenheit As Double) As Double Dim celsius = (5 / 9) * (fahrenheit - 32) Return String.Format("{0:F}", celsius) End Function End Class ' TemperatureConversionForm
My Information
- Member Title:
- New D.I.C Head
- Age:
- Age Unknown
- Birthday:
- Birthday Unknown
- Gender:
Contact Information
- E-mail:
- Private
Friends
dcarp757 hasn't added any friends yet.
|
|


Find Topics
Find Posts
View Reputation Given
|
Comments
dcarp757 has no profile comments yet. Why not say hello?