Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
This is text entry box that remembers previously e...
Author:
Siddharth Srivastava
E-mail:
Click to e-mail author
Submitted:
12/18/2002
Version:
VB4
Compatibility:
VB4, VB5, VB6
Category:
Controls
Views:
11083
This is text entry box that remembers previously entred names.Similar to login text boxes of various email programs.
Declarations:
'none
Code:
' This is general section Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Integer, ByVal wParam As Integer, lParam As Any) As Long Private Sub Command1_Click() ''' open file for writing data ''' create file on disk ''''implement later in active -x Open "C:\memtext.txt" For Append As #1 Print #1, Text1.Text Close #1 List1.Visible = False End Sub Private Sub Form_Activate() ''' Load data from file Dim StringHold As String Open "C:\memtext.txt" For Input As #1 List1.Clear While Not EOF(1) Input #1, StringHold List1.AddItem StringHold Wend Close #1 End Sub Private Sub Form_Click() Text1.Text = List1.List(List1.ListIndex) List1.Visible = False End Sub Private Sub Text1_Change() List1.Visible = True List1.ListIndex = ListboxFindString(Text1, List1.hWnd) End Sub Private Sub Text1_KeyPress(KeyAscii As Integer) If KeyAscii = 13 Then Call Command1_Click End If End Sub Function ListboxFindString(strSearchString As String, lHwndListbox As Long) As Long Const LB_FINDSTRING = &H18F ListboxFindString = SendMessage(lHwndListbox, LB_FINDSTRING, -1, ByVal strSearchString) End Function
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement