Click here to Skip to main content
16,011,542 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionRichTextBox find and replace Pin
Steven J Jowett23-Jan-08 6:12
Steven J Jowett23-Jan-08 6:12 
AnswerRe: RichTextBox find and replace Pin
Steven J Jowett24-Jan-08 1:57
Steven J Jowett24-Jan-08 1:57 
GeneralConnecting to remote data Pin
dptalt23-Jan-08 5:35
dptalt23-Jan-08 5:35 
GeneralRe: Connecting to remote data Pin
Justin Perez23-Jan-08 5:45
Justin Perez23-Jan-08 5:45 
Questionsetup wizard Pin
Agbaria Ahmad23-Jan-08 3:25
Agbaria Ahmad23-Jan-08 3:25 
AnswerRe: setup wizard Pin
Muhammad Shahid Farooq23-Jan-08 6:04
professionalMuhammad Shahid Farooq23-Jan-08 6:04 
GeneralListbox LostFocus event Pin
manisghouri23-Jan-08 1:54
manisghouri23-Jan-08 1:54 
GeneralRe: Listbox LostFocus event Pin
C1AllenS23-Jan-08 18:15
C1AllenS23-Jan-08 18:15 
Hello,

What I understand from your email is that you may not have set the Focus on the Listbox
while making it visible. Based on my understanding, I created a very basic application
with a ListBox and a button. On Button Click event, I make the List box visible and set
the focus on the control. On the LostFocus event, I set the visibility to false and it
seems to be working.

Here is the code that I have used.

Public Class Form1<br />
<br />
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
<br />
        ListBox1.Visible = True<br />
        ListBox1.Focus()<br />
<br />
    End Sub<br />
<br />
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
<br />
        Dim i As Integer<br />
<br />
        For i = 0 To 20<br />
<br />
            Me.ListBox1.Items.Add("Item " & i.ToString)<br />
<br />
        Next<br />
<br />
        ListBox1.Visible = False<br />
<br />
    End Sub<br />
<br />
    Private Sub ListBox1_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.LostFocus<br />
<br />
        ListBox1.Visible = False<br />
<br />
    End Sub<br />
<br />
    Private Sub ListBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ListBox1.SelectedIndexChanged<br />
<br />
        ListBox1.Visible = False<br />
<br />
    End Sub<br />
End Class


Try setting the focus on the Listbox while making it visible. In case I have misunderstood it, let
me know.

Regards,
Allen

Allen Smith

Software Engineer
ComponentOne LLC
www.componentone.com

GeneralRe: Listbox LostFocus event Pin
manisghouri24-Jan-08 2:45
manisghouri24-Jan-08 2:45 
GeneralUnspecified Error in OleDB.oleDbConnection Pin
SekharOne23-Jan-08 1:23
SekharOne23-Jan-08 1:23 
GeneralRe: Unspecified Error in OleDB.oleDbConnection Pin
Kschuler23-Jan-08 5:37
Kschuler23-Jan-08 5:37 
GeneralRe: Unspecified Error in OleDB.oleDbConnection Pin
SekharOne23-Jan-08 17:29
SekharOne23-Jan-08 17:29 
GeneralRe: Unspecified Error in OleDB.oleDbConnection Pin
Kschuler24-Jan-08 3:20
Kschuler24-Jan-08 3:20 
GeneralZoomIn and ZoomOut a panel [modified] Pin
Rupesh Kumar Swami22-Jan-08 23:57
Rupesh Kumar Swami22-Jan-08 23:57 
GeneralRe: ZoomIn and ZoomOut a panel Pin
nishkarsh_k23-Jan-08 20:41
nishkarsh_k23-Jan-08 20:41 
GeneralUndefined class Pin
Hakan Bulut22-Jan-08 23:08
Hakan Bulut22-Jan-08 23:08 
GeneralRe: Undefined class Pin
Dave Kreskowiak23-Jan-08 2:02
mveDave Kreskowiak23-Jan-08 2:02 
GeneralInitializing and connecting to a socket and sending some data. Pin
Benny_Lava22-Jan-08 23:02
Benny_Lava22-Jan-08 23:02 
Questionwinsock state Pin
Agbaria Ahmad22-Jan-08 22:43
Agbaria Ahmad22-Jan-08 22:43 
AnswerRe: winsock state Pin
Sam Xavier1-May-08 23:17
Sam Xavier1-May-08 23:17 
GeneralDataset -deallocation of memory Pin
Sipder22-Jan-08 22:26
Sipder22-Jan-08 22:26 
GeneralRe: Dataset -deallocation of memory Pin
Dave Kreskowiak23-Jan-08 1:50
mveDave Kreskowiak23-Jan-08 1:50 
Generaldatagridview: Lost focus of cell Pin
nishkarsh_k22-Jan-08 21:13
nishkarsh_k22-Jan-08 21:13 
GeneralRe: datagridview: Lost focus of cell Pin
Kschuler23-Jan-08 5:43
Kschuler23-Jan-08 5:43 
GeneralI want to use SQL reporting Service.Don't know from where to start Pin
Sipder22-Jan-08 21:08
Sipder22-Jan-08 21:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.