Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Here is the code, and my apps crashes after it is done!

       Dim sServerFav_new As String
       Dim serverfav_rm As String
       serverfav_rm = lbfavserver.SelectedItem
       Dim i
       For i = 0 To lbfavserver.Items.Count
           lbfavserver.SelectedIndex = i
           If lbfavserver.SelectedItem <> serverfav_rm Then
               sServerFav_new = sServerFav_new + lbfavserver.SelectedItem + "|"
           End If
       Next i
       MsgBox(sServerFav_new)

Posted

i'm added a lisbox with keep ip addresses, and a add and remove button and this code is for the remove button so it remove the selectet item and recoposes the string to save in the regestry,

and there is nothing after this acepte end sub

here is the code fot both buttons:

   Private Sub cmdaddserver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdaddserver.Click
       Dim sServerFav_new As String
       Dim serverfav_Add As String
       serverfav_Add = InputBox("Ip Adress", "Add Server")
       sServerFav_new = sServerFav + serverfav_Add + "|"
       SaveSetting("ApacheMon", "Settings", "sServerFav", sServerFav_new)
       sServerFav = sServerFav_new
       serverfav_reload()
   End Sub

   Private Sub cmdrmserver_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdrmserver.Click
       Dim sServerFav_new As String
       Dim serverfav_rm As String
       serverfav_rm = lbfavserver.SelectedItem
       Dim i
       For i = 0 To lbfavserver.Items.Count
           lbfavserver.SelectedIndex = i
           If lbfavserver.SelectedItem <> serverfav_rm Then
               sServerFav_new = sServerFav_new + lbfavserver.SelectedItem + "|"
           End If
       Next i
       MsgBox(sServerFav_new)
   End Sub

  • *Experts*
Posted
Ah yes, that will do it. For some reason I was under the impression it was just closing without an error message (I guess because he said the application "terminates" -- I've been subclassing VB6 too much I guess :p). :o

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...