Solved

Visual Basic:  Building Menus

Posted on 2011-02-10
25
580 Views
Last Modified: 2012-05-11
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
Comment
Question by:itsmevic
  • 14
  • 4
  • 4
  • +1
25 Comments
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 34868409
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
 
LVL 83

Expert Comment

by:CodeCruiser
ID: 34869675
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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34876813
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
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 34876880
@craisin...it's obviously homework...
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34876912
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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34876915
ItsMevic....perhaps you could post the code you already have written?
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34876932
A couple of hints though (if it is homework).

Look into the "Round()" function and the "CDbl()" function.
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34877074
Those function by the way are VB6.

You will have to look at the equivalent in VB.Net
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34881761
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
 

Author Comment

by:itsmevic
ID: 34885810
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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34885839
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
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:itsmevic
ID: 34885842
Thank you, look forward to reading it.
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34889104
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
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 500 total points
ID: 34889358
"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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34891637
Please stand by for my step by step instructions for this project.

The code alone is not enough to produce your output.


0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34893647
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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34894539
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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34896164
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
 

Author Comment

by:itsmevic
ID: 34897547
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
 

Author Closing Comment

by:itsmevic
ID: 34897557
Thank you BOTH for your input and willingness to help.
0
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34898211
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
 
LVL 85

Expert Comment

by:Mike Tomlinson
ID: 34898245
@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
 
LVL 13

Expert Comment

by:Chris Raisin
ID: 34902026
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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

760 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now