Similar Threads:
1.list boxes in visual basic .net
I am coding an application in .net using a list box. I have the listbox
property set to MultiSimple. I can click on several different selections (or
all) in the list box, but only the first one is the "active" one. What I
want to do is create an application that someone can order menu items from(I
am a beginning .net programmer). Here is my code that can allow one
selection:
'defines structure
Structure MenuItems
Public strItem As String
Public decPrice As Decimal
End Structure
'declare module level array
Dim mitmMenuItems(7) As MenuItems
Private Sub frmsmoke_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'fills mitmmenuitems array with menu items and prices from
'a sequential access file
'declare variables
Dim sreStreamReader As IO.StreamReader
Dim intNumber As Integer
Try 'turns on error trapping
'creates a streamreader object by opening text file for input
sreStreamReader = IO.File.OpenText("smoke.txt")
'process loop instructions until end of loop is encountered or _
'no more text to read
Do Until sreStreamReader.Peek = -1 _
OrElse intNumber >= mitmMenuItems.Length
'reads an items price and assign to array with info on
separate _
'lines in the file
mitmMenuItems(intNumber).strItem = sreStreamReader.ReadLine()
mitmMenuItems(intNumber).decPrice = _
Convert.ToDecimal(sreStreamReader.ReadLine())
'adds item to list box
Me.lstorder.Items.Add(mitmMenuItems(intNumber).strItem)
'updates array
intNumber = intNumber + 1
Loop
'closes file
sreStreamReader.Close()
Catch ex As Exception
MessageBox.Show(ex.Message, "Smoke Shack BBQ", _
MessageBoxButtons.OK, MessageBoxIcon.Information)
End Try
End Sub
Private Sub btnexit_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnexit.Click
'closes app
Me.Close()
End Sub
Private Sub btnclear_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnclear.Click
'clears controls
Me.lblsub.Text = ""
Me.lbltax.Text = ""
Me.lbltotal.Text = ""
Me.lstorder.ClearSelected()
End Sub
Private Sub btncalc_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btncalc.Click
'searches array for item selected in lstorder control
'declares variables
Dim strSearchFor As String
Dim intNumber As Integer
Dim decItemPrice, decTotal As Decimal
'initialize variable
strSearchFor = Convert.ToString(Me.lstorder.SelectedItem)
'add 1 to array subscript until items are located in array
Do Until mitmMenuItems(intNumber).strItem = strSearchFor
intNumber = intNumber + 1
Loop
How can I go about adding multiple selections and adding up all selections
to get a total price? Right now, I have changed the .SelectedItem to
.SelectedItems and it says that my array is out of bounds.
Any help would be appreciated,
Thanks,
Dave
2.data bound list boxes in visual basic .net
Hey all,
I have a windows form with a list boxes. I have data bound the list boxes
with data from my sql database. I want to use drag and drop to allow users
to choose different options from the list boxes on the form and drag them
into another empty list box that is not bound to any data when the form
loads. I was wondering is it possible to use drag and drop with data bound
list boxes ? If it is possible do you know of any place on the net that
shows a good example ?
P.S. I can implement drag and drop when the list boxes are not data
binded...
Thanks in advance!
Dwayne
3.drag/drop with data bound list boxes in visual basic .net
Hey All,
I have been trying to implement drag and drop with data bound list boxes .
Does any one know if its possible? I have been getting just the data row
when ever I do the drag and drop or I have been getting the selected index
number but I have not been getting the actually data item. I was thinking I
might have to take the selected index number and use that to retrieve the
actual data from the data set ?
Any help is much appreciated
Thank You,
Dwayne
4.Excel 2003 Visual Basic (List Box) in English not running in Germa
We developed an application in Excel 2003 with Visual Basic codes in English.
Our German prospective user has problem with the List Box. The user is
supposed to select chemical ions from the Selection box to the Selected Box.
The ions could be selected or deselected to/from the list box. Selected ions
are then transposed to a Table on the Worksheet. This is working in the
English version. However, the user seem to have problems in selecting &
deselecting some of the ions. Is there any special procedure without actual
translation on our part for the English version to work properly in the
german version.
The password input box is worikng.
Appreciate any help in this matter.
Thanks.
5.Excel 2003 Visual Basic (List Box) in English not running in G
Joel,,
It seems strange too. Since I do not have a German version I can not really
isolate the problem. We run the program using a Japanese version and there
was no error. In fact my first thought was the interpretation of the
subscript & superscript which I did not use in this case.
The VBs are a simple upload and selections for placement on another
spreadsheet where I do all the calculations.
One thought that came into mind is the Reference Library. I used the Visual
Basic for Application, MS Office Excel Object Library, Microsoft Forms. I
suppose if the version are different, that would cause a problem.
Thanks for your response.
"Joel" wrote:
> I think you need to isolate the problem futher. It is strange that some of
> the IONs can be selected and others can't. Are you using some change event
> to automatically move the selected item to the box or are you using a button.
>
> If you have a change event I would add a message box in the change event to
> help isolate the problem. See if the problem is the event stopped working or
> if there is problems moving the data.
>
> I'm thninking that the events are disabled because of some error, or the
> German version isn't recognizing a change in the selected item. If two IONs
> get translated to German to the same Text then the German version may not be
> recognizing the Text has changed.
>
> "Lily" wrote:
>
> > We developed an application in Excel 2003 with Visual Basic codes in English.
> > Our German prospective user has problem with the List Box. The user is
> > supposed to select chemical ions from the Selection box to the Selected Box.
> > The ions could be selected or deselected to/from the list box. Selected ions
> > are then transposed to a Table on the Worksheet. This is working in the
> > English version. However, the user seem to have problems in selecting &
> > deselecting some of the ions. Is there any special procedure without actual
> > translation on our part for the English version to work properly in the
> > german version.
> >
> > The password input box is worikng.
> >
> > Appreciate any help in this matter.
> >
> > Thanks.
6. Slow Visual Basic File List Box on Windows 2000
7. pop-up box visual basic dot net and ASP dot net
8. Creating address list personal distribution lists with visual basic