listbox

From: Pierre (jp.vsNO_at_pandora.be)
Date: 06/05/04


Date: Sat, 05 Jun 2004 13:18:59 GMT

hey, first of all, many thx 4 the help

this is my problem, i'm saving names in a listbox. just names, nothing
more, now i wanna take the first name out of the listbox (for saving
purpose in a Database), so i want to take the name at the first index.
now how do i do that. i wanna read the first name and than delete it.
how do i do that. the adding part of the names was easy, but the
retrieving part is hard.

this is the adding part
    Private Sub txtnaam_KeyPress(ByVal sender As Object, ByVal e As
System.Windows.Forms.KeyPressEventArgs) Handles txtnaam.KeyPress
        Dim dummy As Char
        Dim succes As Boolean
        Dim geboortedatum As Date

        dummy = e.KeyChar
        If dummy = Chr(13) Then
            lst_namen.Visible = True
            lst_namen.Items.Add(txtnaam.Text)
            Do
                geboortedatum = Date.Parse(InputBox("Geef de Geboorte
                                Datum in", "GeboorteDatum", "1/1/1900"))
                If geboortedatum > System.DateTime.Today Then
                    MsgBox("Een fout jaar , geef de juiste geboorte datum
                                 in!!", MsgBoxStyle.Exclamation, "Foute Geboortedatum")
                    succes = False
                Else
                    succes = True
                End If

            Loop Until succes = True
            lstGebDatum.Items.Add(geboortedatum)
            txtnaam.Text = vbNullString
            txtnaam.Focus()
        End If
    End Sub
    
but how can i get the first item from the list?
i've got
lstgebdatum.selectindex = 0
but than?

thx a lot , hope i've described my problem clearly.



Relevant Pages

  • Re: control panel has two columns instead of three
    ... I can change the spacing in the listbox. ... > thx!! ... >> Yannick Chamming's ... >>> Is there a way to make the Control Panel display applet icons using ...
    (microsoft.public.windowsce.platbuilder)
  • Re: how can i export a report to a jpg format?
    ... but actually i wanna ask if VBA can do this or not? ... as my boss dun wanna spend extra more money.. ... >You can use SnagIt from Techsmith ... >> thx in advance. ...
    (microsoft.public.access.reports)
  • Re: Copy range and paste into MS Paint
    ... Thx for the solution! ... the code to force saving into .JPG format, the quality seems to be a lot ... How can I improve the image quality resulting from using the macro so ...
    (microsoft.public.excel.programming)
  • Re: D8: first impression and uneasy feeling... (long)
    ... > Because saving and loading the contents of a list box to and from a ... Its not just listbox. ... type in Delphi. ...
    (borland.public.delphi.non-technical)
  • Re: File Save As Dialog
    ... So, are you saying you want to just save it if they are saving, ... is not supporting automation of "Save As". ... thx. ... If you are only looking for a folder ...
    (microsoft.public.vc.mfc)