Making A List Box Hold A Value?

Nov 30, 2011

I am a first year coding student and we are starting out with Visual Basic. Up until now I have been able to figure everything out, but I have run hard into a wall and I don't feel like I've been taught how to get over it. Here's the thing.

First Form

Contains a list box for products selected, and four text boxes for Subtotal, Tax, Shipping and Total.

Second & Third Forms

Each contain a list box of books to select from which will be added to the first form.[code]....

I feel like I am doing it wrong right out of the gate - as you can see I am going by the item that the user chooses, and adding a constant value that I have pre-defined in a module. Then I add the name of the book to the first form - but here's the issue.That text string doesn't hold a value.SO, when I use the remove button on the first form - the text string removes but the subtotal, tax, shipping and total boxes do not change in the least bit because the item that I removed doesn't retain any value.

View 6 Replies


ADVERTISEMENT

Fastest Way To Hold A Big List Of Something?

Jun 24, 2009

so the way I have this working now I'M using System.Collections.Generic.List(Of T) for holding 100's of a structure.Dim Users as New List(Of User)

I was wondering if there was any better way or faster list container or something like this in the .net framework?

View 5 Replies

Generics - List(Of T) - Use It To Hold Items Of Several Types?

Oct 3, 2009

Assuming a base type of "Message"...

[Code]...

I would like to have one collection of Message objects which can be either PhoneMessages or MailMessages, so that I can iterate through the list and deal with each message based on what type it happens to be.

Attempting just to use .Add() fails, saying that I can't add an item of type PhoneMessage to a List(Of Message). Is there some elegant way to accomplish what I'm trying to do? I had thought I could accomplish this with generics, but I think there's a gap in my understanding. If it can be accomplished in .NET 2.0, that would be ideal.

View 4 Replies

Limit To The Maximum Amount A List(Of T) Can Hold?

Aug 3, 2009

Is there a limit to the maximum amount a List(Of T) can hold? I need to know because I have a program that could potentially wind up in a really large loop that would add over 200 or so items to a list at one time.

MSDN search didn't really tell me much, but I'm in a rush at the moment, and was just wondering.

View 8 Replies

Create A List (of My Custom Structure) To Hold Only Unique Items?

Mar 8, 2012

How can I create a list (of my custom structure) to hold only unique items? This list should be created from another list.[code]...

View 5 Replies

VS 2005 List(of T) - Create A List To Hold More Than One Control Type Or Create A List For Each Control Type?

Jan 20, 2011

If I create a list for a TextBox:

[Code]....

I am able to only add controls that are of type TextBox. My question to you is, can I create a List to hold more than one control type or do I have to create a list for each control type?

View 8 Replies

Making A To Do List In Vb 2008

Feb 9, 2011

I want to create an app that is constantly running and as part of my desktop toolbar. When I mouse over the icon, I want the list to show in front of all other windows on the screan. I, also, want it to fade away once the mouse leaves the icon.If the icon is clicked, the window displays.

I want to be able to click-and-hold the title bar to move it around when the window is displayed. I want the full display of the window to be a check box list with each line being ~25 characters long. At the top of the window, there should always be an open line on top of the list where I can enter a new "task," and hitting the "ENTER" key will save the line and move it down one line, as well as the entire list underneath

The action of ENTERing a new "task" should spawn a new open line at the top of the checkbox where the user can enter a new task. When a box (located to the left in front of each line of text) is checked for a line, that line will disappear."Checking" a box should move every line underneath of the Checked (and thus deleted) line up one line. There should be a "close" or "minimize" (depending on how you keep in to the task bar) button the hide the app when I'm through using it.

View 1 Replies

Making File Name Show In List Box?

Feb 19, 2009

Private Sub importdiag_FileOk(ByVal sender As System.Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles importdiag.FileOk
For Each track As String In importdiag.FileNames
playlist.Items.Add(track)
Next
End Sub

[code].....

This is the current code im using. it shows in the listbox i have the file that i select. It also shows how ever where its located. Ex. C:folder\folder\file. I want only the files name to show up in the box but i cannot figure it out.

View 3 Replies

VS 2008 Making A List Thread Safe?

Aug 26, 2009

I am using WCF to make a chat application - I dont think the fact I'm using WCF is relevant for this particular question but just thought I would mention it in case there is something special about the way WCF does threading that I dont know about.So I have my WCF service that runs on a server and a WPF app that acts as the WCF client - each time a new client signs in or out it updates the server WCF service to let it know that it has changed status. The server then updates a list to either add or remove the user, so this list basically represents who is online at any one time. The list is declared in the core server class like so:

vb.net
Private Shared List(Of ChatUser)

So, I have a method in my server side that is called whenever a user needs to be added to this list and originally I thought I could have some issues because while the server might be looping through this list to find out who is online, another user might have signed out and the list would therefore be modified while the server was looping through it which would cause an exception. So I added the following to the start of the method that removes a user from the list:

vb.net
SyncLock New Object

and I havent had any problems... but I'm still not totally convinced that this will completely solve the issue. So would creating a Property give me a bit of extra safety? Assuming I always used the property to access the list in my code.
Like this:

vb.net
Private Shared Property CurrentClientList() As List(Of ChatUser)
Get
SyncLock New Object

[code].....

Also, am I actually using SyncLock correctly? I mean should I be referring to a shared object that all of the threads can access rather than just doing New Object each time or does it not make a difference?

View 9 Replies

Making A FTP Chat And Online User List(No Database)?

Jan 11, 2012

I'm making an FTP chat for me and my friends just for practice. how to make the following things:

Online user list(No Database)
Banning System

View 3 Replies

Making A Website/project Portable - Check List?

Mar 14, 2009

I have an ASP.net 3.5 website and I am using vb.net in VWD 2008 Express, I am also using MS SQL Server 2008 Express, I used ajax tabs and a textBox characters counter control developed by [URL]..The database is attached with MS SQL Server Management Studio Express and the files are stored in the SQL default "Data" folder.

The whole project's code and forms are stored in a folder in my E drive. I need to hand the whole project to another coworker who have to finish it, please describe in steps how can i make my website portable (like i can put it all in a folder that he can carry around in his flash disk).One more thing, I already finished my side of the project, I need to ship it out to this other programmer.

Can anyone suggest something like a: Checklist or Must Do list to achieve this?PS: I have had a problem trying to move the project from one server to the other, the project seems to look for the dlls of the AJAX control and the textBox counter where i originally unzipped the folders in which they cam in, which i think was on my desktop, although when i added those controls to the Tools tab, i created a new tab, then i choose the dll from the where i unzipped the controls source code, aint that enough?

View 1 Replies

Making That Loads A List Of Vehicles From A Text File To ListBox1?

May 3, 2010

This switching from VB6 to VB.NET is starting to become a major pain I have a program I am making that loads a list of Vehicles from a text file to ListBox1. When the Selected Item in ListBox1 is clicked, it brings up the Image of that Vehicle, called from an external Image folder, so new Images can be added. I have an 'Add Entry', 'Delete Entry', 'Refresh List', 'Save Changed List', and 'Exit' buttons, all coded and working as I want them to - Everything is working better than I planned, without having to Google my a$$ off finding 'snippets' - I figured most of it out myself - What I am trying to do now is have a ListBox2 populated with a section of the text file:

[Code]...

Part in ListBox2, which when an entry THERE is Selected, it can be edited in TextBox2.Is this as hard as it seems? I want all the Vehicle Stats for that Vehicle to show when the Vehicle is Selected, and have the Stats section editable...

View 21 Replies

Making A Membership List - Load With Just The Names In The Text File That Is In The Debug Bin

Oct 26, 2009

Here is the code for my program. We are making a membership list and it needs to load with just the names in the txt file that is in the debug bin. The txt file is set up in one column and holds the member name and the next line is member number and so on. Information is read into an "array of structures" and the display is supposed to be ONLY the names in the listbox on load. This is my problem. I had it displaying all th txt file info and I just need the names. I tried what you will see in the code but it is not working and my book is less then helpful when it comes to examples and/or knowledge on the subject. Though it could be too many hours spent trying to get it to work.

Imports System.IO
Public Class frmMemberList
Structure Members
Dim member As String
Dim number As Integer
End Structure

[code]...

View 13 Replies

Designing Software - Making A MPC Sampler - Drum Machine - Making A Sound Directory ?

May 16, 2012

I'm a huge music person (got my own lil record thing going) but I'm wanting to design a program that would make music in my way. I have a decent amount of background knowlege of Visual Basic and Java I'm just wondering how could I execute this whole project. The Project is making a MPC Sampler. MPC is a drum machine; a machine with buttons that once you press it that it will play a sound from a drum (ex: snare, kick, tom, ect.) . So I would want to make some pads on my program that each have their own sound. Total of 16 pads. Which the design wouldn't be hard to make nor would the functionality of it having the play back sound (in my opinoin it wouldn't be hard atleast). But the thing is I wanna map out these pads to number keys on the number pad or keyboard. I'm not so sure how to do that. But that's all the easy stuff...

Also finding information is making a sound directory. What I mean by this is that I want to make a User Interface that will open up a file directory of sounds and the user can select what "kick" or "snare" sound he may want for the kick or snare pad. I don't know how to do that or even know what to search; neverless I don't know if this whole project idea is a good idea for Visual Basic or another programing language.

Also LATER ON I am wanting to add a record and export function that alows users to..well...record and export their beat or instrumental ha. That doesn't seem too too complex (mainly due to the fact that all it needs to do is record the users key strokes and then show them and play the sounds, but obviously it would get more complex than that.)

Here is an image of one of many MPCs but one with a directory - [URL]

View 5 Replies

Best Way To Hold App Settings

Dec 2, 2010

I'm building a new industrial app using MODBUS/TCP talking to a DAQ unit that will have a lot of parameters and will need to be adaptable for different scenarios. For example, the units I'm connecting to have 12 inputs and 6 outputs, mapping for those may be different for each installation, and in one instance I'll be talking to 4 units together - if that's the best way to do it - each one will have identical parameters, just a different ID number and ip address. They will all be writing to a SQL Server database. Not sure if I'm better off having a Tab control with each unit on a separate tab or a different instance of the app for each one. Is one better than the other? The units will be polled every 200-500ms. 500ms seems to be more stable.

With so many parameters, is it better to store all them inside the application and access them through My.Settings or would I be better storing them in a database, either the SQL Server DB or maybe something like SQLite (one of my faves) or is there a better way?

Not done anything quite as big as this before and first time with MODBUS, but that bit is working a treat.

View 1 Replies

Hold A Date Value?

Nov 11, 2009

I am writing a program that is going to take two dates (entered by a user) and compare them against each other to determine when something was purchased vs when it was paid for. I'm ok with everything except one part, and its a biggie, how do I have the user enter the dates (format) and how do I convert it from a string to a recognized date format? Does that make sense?

View 4 Replies

Hold Left Key Down?

Mar 13, 2012

Currently, I use SendKeys.SendWait("{Left}")

How can I hold the left arrow down?

View 13 Replies

How To Hold Up A Console App

Oct 26, 2011

I really want to do this the proper way, it's just that I've been doing it the wrong way for so long, I can't seem to get past it.

in a console app if I start a timer or kick off a thread or bgw, the sub main runs right on thru and the app finishes and closes.

i need the sub main to just hold position until some event is raised then handle the event and come back to sub main or end depending if the event that was raised told us to end or not.

what I would normally use is this:

Do While KeepLooping
Wait(5D)
CheckTimedEvent()
Loop

View 5 Replies

VS 2010 - Hold Key Down For Only One Second?

Jun 4, 2012

So, if this is how to hold a key down for an infinite amount of time:
keybd_event(CByte(Keys.Right), CByte(MapVirtualKey(Keys.Right, 0)), 0, 0)
How can I hold it down for only 1 second?

View 3 Replies

Run The Exe And Not Have Any Sub Folders To Hold The Images?

Jan 22, 2009

i have maid a program witch has images in it from my hdd. Now when i build my program and send it to other ppl thay cannot see the images. i know this is becaws the path i directed to pull the images from is not on there pc nor do thay have the images lol. so my question is how do i put the images in the actual exe as in the actual program that i have built so all the images and stuff are all in there. so thay only need to run the exe and not have any sub folders to hold the images.

View 1 Replies

How Many Rows Can A Listbox Hold

Jul 11, 2011

I have over 9,00,000 records in my Access database but only a fraction of that is being displayed in the listbox. How Many Rows Can A Listbox Hold? Around 65K is the answer I got from my research.

View 3 Replies

Structure To Hold 2 Strings?

Nov 29, 2011

I like to create a Structure that could hold 'Yes' or 'No' only; just like a Boolean variable could hold True or False.

View 12 Replies

Using XML As Database And Uses Dataset To Hold The Xml?

Jan 6, 2010

im using XML as my database and uses dataset to hold the xml. which one do you think is better to backup my xml?

1. write the xml to 2 location, default location and the backup location

dataset.writexml(path1)
dataset.writexml(path2)

2. write the xml to default location and copy it to the backup location

dataset.writexml(path1)
copyfile(path1,path)

if you have a better way of doing it please dont hesitate to share it..

View 1 Replies

.NET Snake Game Freeze When Hold A Key Down?

Dec 24, 2011

I'm trying to make the classic Snake game in VB.NET, but if I hold a key (any key) during the game, after a few seconds the game freezes until I release the key. I've tried lots to fix this, but nothing works, maybe because I don't understand the problem.I'm assuming that when I hold down a key, the Form1_KeyDown function gets called, and when, after a few seconds, the key goes into "I'm being held down" mode, that function is constantly called, so the timers don't get a chance to update. But like I said, I'm probably wrong.

I've been struggling with this for a while. I think this is all the necessary code, please let me know if it isn't.

[Code]...

View 3 Replies

Access Database To Hold Data For VB App?

May 3, 2010

I have a bit of a problem. I am using an Access database to hold data for my VB app. In the VB app, I have a data source thats pulling data from the database.

I modified the database today, deleted some tables, added another one, but the data source in the project window does not show these updated changes. I had to reconfigure the datasource with the wizard to get the changes to update.

Is there a way that i can get the data source to update itself when the form loads?

View 3 Replies

After Add And Refresh Textboxes Hold No Data

Oct 13, 2011

I'm not sure if this is a simple problem or not but it's frustrating me to no end.

I'm using the following code to add my data to the database, and then this to refresh. [code]...

View 6 Replies

Asp.net - .NET Textbox Changed But Still Hold Initial Value?

Apr 5, 2010

I've never come across this before:I have a series of text boxes. The text of these boxes get set on page load. then I have a submit button that calls a sub to update the table with the new values (text) in the text box. The problem is it is keeping the original text not the text that is CURRENTLY in the textbox. Anyone come across this before? Or know how to get round it?

[Code]...

View 1 Replies

Best Way To Set Up Server That Could Hold Multiple Databases

Apr 5, 2010

connect my vb.net application to a remote sql server database, so every one who installs the application would be able to connect to the same remote database. the application would obviously require the internet to run.i also want the option to add more databases in the future, preferably one for each business who would use my software.i am wondering the best way to set up this server that could hold multiple databases. i would think i have two options:

1) set up the server myself on a dedicated computer

2) pay for some type of service that host sql server dataases

so how would i go about executing these options? i dont know the first thing. which option is better?i do however know how to connect to a remote database so thats not what i am asking.

View 5 Replies

Control That Can Hold Html Page?

Feb 3, 2011

what control can hold an html page? vb.net2003 windows app

View 4 Replies

Create Array To Hold Xml Data

Aug 10, 2011

I want to store the contents of an XMl file into an array but struggling to work this out. I have managed to read the data in and store in labels as a test. I then created an array list and used a message box to display the data to see that it has been stored. It does but I am not sure how to group this data. There are 3 records in the file. the idea is to end up with the following:

[Code]...

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved