Building a Graphical HOSTS File Edit Utility
by Michael Otey

LISTING 2: List_HOSTS_MouseDown Subroutine

Private Sub List_HOSTS_MouseDown(Button As Integer, _ 

	Shift As Integer, x As Single, Y As Single) 

		Dim iTemp 

		Dim sTemp As String 

		On Error GoTo MouseDwnExit 

		If Button = vbRightButton Then 

			List_HOSTS.ListIndex = Y / (List_HOSTS.Height / 22) 

			'Get the first character of the line 

			sTemp = Left$(List_HOSTS.Text, 1) 

			If IsNumeric(sTemp) Then 

				Menu_Ping.Visible = True 

				hyphen2.Visible = True 

			Else 

				Menu_Ping.Visible = False 

				hyphen2.Visible = False 

			End If 

			PopupMenu Menu_Popup 

		End If 

 MouseDwnExit: 

 End Sub