|
Yep. It doesn't matter what you call the shortcut, so long as the filename is Notepad.exe, that's the way it'll show up in TaskManager's Processes tab.
|
|
|
|
|
Alright thanks, sorry for all the confusion, and wasting your time.
|
|
|
|
|
It's not wasting time if it gets everyone on the same page.
|
|
|
|
|
I am a noobie in programming in VB and I would really appreciate anyones help on a windows form I have to create.
In this application I should be able to enter an infinate amount of numbers into the OPERANDS LISTBOX, when the list box containts at least two numbers, the event handler should then enable the addition and multiplication Buttons. (I GOT THAT NO PROBLEM)
Then I have to define the ADD BUTTON. This event handler should compute the sum of all the values in the OPERANDS LISTBOX and display the result in the resultLabel.
Also need to define the Multiplication BUTTON. I need to compute the product of all the values in the Operands LISBOX and display the result in the resultLabel.
It is either the ADD or Multiplication BUtton, NOT BOTH.
Here is the CODE for the addition handler:
Private Sub addButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles addButton.Click
Dim total As Integer = 0
Dim operandCounter As Integer = 0
Dim sum As Integer = 0
Dim addition As Integer = 0
' sum grades in ListBox
Do
sum = operandsListBox.Items.Item(operandCounter)
total += sum 'add sum to total
operandCounter += 1
Loop Until operandCounter >=2
WHen I fill in the list box with more then 2 numbers, it only add the first two numbers. I know I am aware that it is because I have only stated until >=2, but what code should I use if there is no limit to the number of times that a user can input numbers into the listbox???
So far I have only been able to get 2 items in the listbox to compute correctly and display on the listbox using the loop functions until and while, but I have been trying for hours to get this working when I have more then 2 items on the listbox, I know I can just increase the number, but I need to be able to grab all items in the list box and ADD (ADDBUTTON) or MULTIPLY (Multiply BUTTON) and display either one on the resultLabel.
PLEASE SOME ONE TAKE THE PAIN AWAY!
THANKS!
ALex
|
|
|
|
|
Look at the foreach keyword, or the Length property of the Items collection.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Sorry am still lost, can you explain?
|
|
|
|
|
Well, this is obviously your homework, I have you the keywords you need to look at your texts or google, and you gave me a 2 vote, but you want me to hold your hand through it ?
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
It was an accident. I am new to this site, it was not my intention to give you a two.
Sorry
Oh and by the way, it WAS my homework, I got a grade already, but professor does not seem to have time to tell me what I did wrong, so that is why I am posting it here.
|
|
|
|
|
Weird - seems like you can change your votes now ? You used to be told you'd already voted....
Anyhow, the foreach keyword lets you iterate over items in your listbox. The Length ( or Count ) property lets you know how many items there are. In both cases, this means you can write code that steps over all the items in the collection, instead of your code assuming a set length.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thank you sir, I will try to apply it today and let you know how it went.
Thank you very much for taking the time to explain this.
Alex
|
|
|
|
|
Sorry I don't know how to apply what you stated.
|
|
|
|
|
Loop While operandCounter<operandsListBox.Items.Count
|
|
|
|
|
Loop While operandCounter<operandslistbox.items.count>
|
|
|
|
|
Hi I wonder if anyone could possibly help me before I tear my hair out.
I written an application in vb.net 2008 express. I'm using InnoSetUp to install it. Withing the set up file I've got links to the .net framework 3.5 install and the SQL Server 2005 install.
Installing on my Vista lap top, which I wrote it on, no probs. As soon as I install on my Pc, XP then I get an error stating that there is already a database of that name or this one is installed elsewhere.
I've checked security permissions before install (on Vista) and ensured that users have full permission. However, once on XP machine, users only have Read Only access to my database.
Any ideas how I can stop vista changing the permissions so that clients can alter data in database.
Thank you very much
Kris MCP
|
|
|
|
|
What makes you think Vista is changing it, if the issue is on XP ? You can write the code to make the file not read only, if that is the core problem
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Thanks Christian I'll give it a go.
Kris MCP
Kris MCP
|
|
|
|
|
Hello,
I have the following problem:
I have a file path like this: "C:\Program Files\MyProgram\Myfile.ext"
How can I remove the path and only keep the file name, in this case "Myfile"? (I don't want the ".ext" behind it)
Can someone help me please?
Thanks,
Zaegra
|
|
|
|
|
Read up on the Path class.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks, I didn't know it was that simple
Nice work!
|
|
|
|
|
Hi,
I want to remove a value from the default context menu displayed. I dont want to create a new menu as I want to use all the other options in it. Plus I want to add one custom value. Could you tell me how this can be done?
Thanks,
Ahmad
|
|
|
|
|
AFAIK, you'd have to replace the context menu with your own creation, implementing the stuff you would normally find in the menu. I don't believe you can just turn off what you don't want in the default menu.
|
|
|
|
|
i am an amature programer and never used crystal report before.....so would be greatful if anyone would tell me how to use crystal report in vb.Net.
|
|
|
|
|
By a book to get you started, like Crystal Reports for Dummies, depending on the level you wish to start at. The consider what is the best data source for your project.
I tend to populate a Typed DataSet then pass that to crystal for reporting.
Steve Jowett
-------------------------
It is offen dangerous to try and see someone else's point of view, without proper training. Douglas Adams (Mostly Harmless)
|
|
|
|
|
Interesting, I always built the report in CR and linked to a stored proc. The in the app I would open to report object, give it the production connection and pass the report to the viewer.
I ended up writing a whole framework around the delivery of CR within an app , I'm sooo glad to have moved to reporting services .
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I have an arraylist of FileInfo objects. now based on there LastAccessTime property, i want to sort my arraylist. i tried with implementing IComparable interface, but its throwing exception "Failed to compare two elements in the array"
Please help. Thanks in advance.
-Shraddha
|
|
|
|