• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 592
  • Last Modified:

Visual Basic: Building Menus

Hello Experts,

    I'm trying to develop a menu type of application by creating Windows Project in Visual Basic.  The Sample Output from this application contains TWO windows.   Any help with the code here would be GREATLY APPRECIATED.

 Flowchart
 First Sample Window based off of Flow Chart
 Second Sample Window based off of Flow Chart
0
itsmevic
Asked:
itsmevic
  • 14
  • 4
  • 4
  • +1
1 Solution
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Are you kidding me?

The Flow Chart has practically already written the code for you.

Build the Interface and Double Click the Buttons to keep the Click() handler stubs.

Insert the code...
0
 
CodeCruiserCommented:
When you right click on form in designer, click on View Code in menu, do you see code of the form? Show us the code file.
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
I gather you have obtained these flow charts from a publication and simply wish to put them into a Visual Basic application and that you are unfamiliar with how to code in that language. Stand by - I am writing the code for you now. Will be right back.

0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
Mike TomlinsonMiddle School Assistant TeacherCommented:
@craisin...it's obviously homework...
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
OK - if this is homework, please advise us as such.

We cannot really supply an answer for you in that case since it defeats the purpose of EE, which is to help people who are honestly atempting a programming project (their own) and are "stuck".

Yopu can only really learn how to program by doing it yourself.

Do you, itsmevic, honestly vow that this is not an eductaional assignment you have been asked to complete?

If it is not a homework projetc then I have the answer for you.

Please advise.

0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
ItsMevic....perhaps you could post the code you already have written?
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
A couple of hints though (if it is homework).

Look into the "Round()" function and the "CDbl()" function.
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Those function by the way are VB6.

You will have to look at the equivalent in VB.Net
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
I offered to provide full answer once it was stated that the question was not homeowrk.

I spent about 2 hours preparing the complete answer for this question, and was quite prepared to supply the answer to the author on request.

Quality input is more than ready for the author (over 20 screen-shots showing step by step methodology).

I would suggest that the points NOT be refunded. Should the author still want the answer, I am only too plesed to supply them.

I am truly soory if any offence was taken at our endevours to ensure the highest
moral standards at this site.

Please, itsmevic, would you like me to post my prepared answer for you?

Kindest regards....craisin
0
 
itsmevicAuthor Commented:
Hi Crasin,

   Thanks for your heartfelt response.  I get a wee bit preturbed at times especially when people assume.  Please feel free to post your input.  Input is always a positive thing.  Post away.  
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
OK - shall do. I am attending a Bridge club meeting in 30 mins, but will post tutorial as soon as I get home (in about 6 hours)

Cheers
0
 
itsmevicAuthor Commented:
Thank you, look forward to reading it.
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
It is now 3am and I am almost falling asleep after major problems caused by the new release of Acrobat Reader (would you believe?). Nothing to do with your tutorial, but it is just that I am too tired to start it just now.

I will upload the tutorial to you after I have had a sleep. Will be back to upload at 3pm Melbourne time (Australia), in about 12 hours (I have a meeting to go to in the morning)....sorry about the delay. :-)
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
"I get a wee bit preturbed at times especially when people assume."

Is this not homework then?  =\

Where do these flowcharts and images come from?

Anyhoo...

I wasn't kidding; the flowchart practically has the thing written for you already.  

From the flowchart provided, you can deduce the names of the controls:
    areaButton (Button)
    volumeButton (Button)
    exitButton (Button)
    radiusTextBox (TextBox)
    answerLabel (Label)

For example, put a button on the form and change its Name() Property to "areaButton".  Now double click it to get the Click() event stub:

    Private Sub areaButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles areaButton.Click

    End Sub

Again, DIRECTLY from the flowchart, put the code into the stub:

    Private Sub areaButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles areaButton.Click
        Dim Radius As Double
        Dim Area As Double
        Radius = radiusTextBox.Text
        Area = Radius ^ 2 * 3.14159
        answerLabel.Text = "The area of a circle with radius " & Radius & " is " & Area
    End Sub

This would cause an error if the value in the TextBox wasn't a valid Double.  Safer code would use Double.TryParse() and look more like:

    Private Sub areaButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles areaButton.Click
        Dim Radius As Double
        If Double.TryParse(radiusTextBox.Text, Radius) Then
            Dim Area As Double = Radius ^ 2 * Math.PI
            answerLabel.Text = "The area of a circle with radius " & Radius & " is " & Area
        Else
            MessageBox.Show("Value Entered: " & radiusTextBox.Text & vbCrLf & vbCrLf & "Please enter a valid radius.", "Invalid Radius", MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
            radiusTextBox.Focus()
            radiusTextBox.SelectAll()
        End If
    End Sub

Good luck...
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Please stand by for my step by step instructions for this project.

The code alone is not enough to produce your output.


0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
By the way, I can only supply the answer in VB6. The code for VB.Net is shown above (kindly) by Idle_Mind.

Could you confirm what platform you are developing in sso I can upload the appropriate tutorial (if still required).
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
I still have this tutorial to upload in either VB6 or VB.Net. It took me four hours to create. Do you still want them? (if so which one?)
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Moderator, I'm not sure what is happening here.

The author was pleased to accept our responses jointly, and I was just asking if the author still wanted the tutorial I have prepared.

I am happy just to leave things as they are, since we did in fact provide the code
(although basically it was present in the flowcharts) and some advice regarding usage of functions not given in the flowchart code.
Also I have a screen capture step by step tutorial prepared for someone who does not not their way around VB6. The code supplied was in VB.Net (kind submission by Idle_Mind who deserves majority of points if the author wants the code in VB.Net).
If VB6 is required, I would like the opportunity of supplying code in that format via Tutorial.
0
 
itsmevicAuthor Commented:
I apologize Crasin, it would seem EE has become a bit to tightly wound with the way it does business.  Although, you did not provide a technical solution to my issue you were more than willing to help me when others would not and that to me is worth something.  I wanted you to know this.  I'll reassign the full points to Idle Mind.
0
 
itsmevicAuthor Commented:
Thank you BOTH for your input and willingness to help.
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Well I will not waste four hours again preparing solutions which others are not willing to accept.

I think I will reconsider my time spent at EE
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
@craisin...sorry you spent so much time on this.  Perhaps you could make an article out of it?
http://www.experts-exchange.com/articles/
0
 
Chris Raisin(Retired Analyst/Programmer)Commented:
Yes, sorry about that.

I am not well at the moment (impending detached retina in my left eye) and I am afraid I was a little touchy last night when I made my comment. Of course, I will stay with EE provided I do not lose my sight in my eye. After all, I have been with them for 12 years now!

I am glad that itsmevic sorted out the problem and all is now fixed.

Thanks for your comment.

craisin
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 14
  • 4
  • 4
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now