Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
 
  HOME    TRACKER    Visual Basic




Finding List Item As U Typed In Combo Box(Dropdown List Style).


Basically the title say it all.When I type a letter in combo box it finds item by matching the letter that I typed, but when I type in a second letter it searchs item that starts with the second letter.I wonder is there a way to macthing list item as u typed in combo box(Dropdown List style).Thanks in advance.Joon




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Combo Box Style Dropdown List
Is there a way to have initial text displayed in your combobox when using the dropdown list style, because I'm unable to change the text so it appears as empty until clicking on the scroll bar. e.g. I want to have
"-select an option-" so the user will understand there are choices in the combobox.

Problems With Combo Box -Style 2 Dropdown List
I have to use a combo box whose style is -style 2 dropdown box (which i can not change meaning that it is the requirement of a project).The problem is that once something is selected i want that at the click of a button the visible area in the dropdown should clear(i dont want that value to be deleted from the dropdown list just that the dropdown box should look as if nothing has been selected).Now if i use :
dropdown.clear- all the values in the dropdown list are deleted & it becomes a dropdown with no values.
if i use:
dropdown.text = " " -( which works in style 1) it gives me an error "Text property is read only".
Could anyone please help?

Thanks a lot

AddItem To Combo List And Have The Combo List Be Able To Retain The Item Upon Recall
I have a project that I need to do for school. You are to have a command button, a combo/dropdown list and a text box, you are to enter a name and birthday in the text box and when you click on the command button it is supposed to enter it in the combo box. My problem is that I got it to enter into the combo box with additem, but it will not retain the item that I just added. When I close the program the item I added does not stay there. How do I get the combobox to retain everything that I add through the textbox on command click. PLEASE HELP

Combo List - How To Match What Is Typed
How can i validate what the user types in vs what is in the list?

Combo/List Box Scroll As Letter Typed
hi

Does anyone have code that making items' list under combo/list box scroll as we type specific letter? It's like Index search under Help menu of windows applications.

S/o gave me the code earlier but the code didn't give me option to retype another word when I accidently type wrong word

Thanks

Display Combo Box List Matching What's Being Typed
I've found code to suggest what to type while typing into a combo box, but is there a way to show the drop down showing only what matches what you've typed so far?

Setting Combobox Text When Style = Dropdown List
Hello,

I have a Combobox (Style = Dropdown List) that is loaded with its items on the form_load event. After the items are loaded, I want to select a specific item from the list. I tried setting the text property to the item I want displayed, but an error is returned "Invalid Property Value." Is there a way to make this work without setting the style property to dropdown combo (I dont want the user to be able to edit the items in the list after they are selected)?

Thanks for any help.

Defaulting A Item In A Dropdown List..
I have 3 values in my dropdown list, when i run my program it starts with a blank in the dropdown..is there anyway to make it start with the first one on the list?

Select Item In Dropdown List Via Itemdata?
Hi,

I was wondering if there was a way to select an item in a dropdown list via it's .ItemData value as opposed to the .List value..

I know that you can use the following code to select the item via the .List value:


Code:
Combo1 = Combo1.List(1)


How would I select the item via the .ItemData value?

Any help would be appreciated..

Dan

Combo Box (dropdown List)
hey people, i need to make something update after the user has chosen an item from the list, its a dropdown list so you cant type what you like into it, you have to select 1 from the list im a noob so i'm not great at this, but when i use:


Code:
Private Sub ClassSelect_Change()
'
'blablabla code this code that
'
End Sub
it doesnt call it at all and i'm pretty sure its suppose to, is there any way around it?

thanks for any help you can offer!

Combo Dropdown List
I have a combo box named combo1 and its style is dropdown list.
What I need is to be able to set the text or have it selected on of the members in it. So lets say I have 1,2,3,4,5 all in the combobox well when the form loads I want it to have a 1 for its text. Hope this makes sense. Thanks

Combo Dropdown List Help!!
Hi im just in need of some help on how to populate a combobox "dropdown list" type.

I know I can easily do it using a standard combo, but I wanted to use a dropdown list as it stops the end user from editing the entry to something other than the list in the combo.

When ever I try and load the form, the program dies with the following error.

Run-Time Error '383'
'Text' property is read-only

I can work out how to get around this!.

Any Ideas????????
here's the code:
----------------------------------------------------------------
Dim oRSMain As ADODB.Recordset
Dim strConnect As String
Dim strSQL As String
Dim strSQLDet As String

strConnect = INI_getString("String", "ConnectString1", App.Path & "dataconn.ini")

strSQL = "Select * from Orders where OrderID = " & frmOrders.DGridOrdList.Columns(0).Value

Set oRSMain = New Recordset

oRSMain.Open strSQL, strConnect, adOpenForwardOnly, adLockReadOnly

With oRSMain
frmOrders.cboBillCountry.Text = oRSMain.Fields("BillCountry").Value & ""
end with

---------------------------------------------------------------------

Combo Box Dropdown List
I would like to create a combo box that will drop down its menu after the text field has been changed. The following is the API I am using to accomplish this.


Code:
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const CB_SHOWDROPDOWN = &H14F

Private Sub Combo1_Change()
SendMessage Combo1.hWnd, CB_SHOWDROPDOWN, 1, 0
End Sub
It works fine - except for one problem. Whenever it executes the mouse pointer disappears. As soon as the menu looses focus it reappears. Yet this problem seems to undermine the entire purpose of opening the dropdown list in the first place as the user cannot see their mouse.

If anyone has any ideas of why this is happening or how I can fix it I would very much appreciate it! Thank you.

Combo Box Dropdown List
Hi, is there a way to make the "list" display all the items without having a need to scroll? It currently shows 8 at a time, and i have about 20 items on the list

thanks


~~~Dimava~~~

Combo Box - Dropdown List
If I choose the style of the combo box to be the dropdown list, how can I add text in this box?
This code gives an error.

Code:
combo1.text = "Select"

Dropdown List Combo Box
I need to search through a dropdown list of a combo box - via an ocx.
This box is style 2 - i.e. non editable.
I have some code to search through a normal list - style 1, but the change() event does not fire the event.
I can capture the backspace and delete keys, but when I try to capture keycode's - acsii, this also fails.

If anyone has any ideas or even code, please help.

I Want To Call A Sub Immediately After I Select An Item In Dropdown List . Which Event Can I Use?
I have a dropdown list(type 3). I want to call a sub immediately after I select an item in dropdown list . Which event can I use?
I tried lostfocus, change..but not good.

Best Regards,

Kevin Shen

Combo Box Dropdown List State
is it possible to determine that the dropdown list of a combobox/datacombo is closed or dropped down? please show me the code if possible.. tnx.

Refresh In A DropDown List Combo
Hello!!

I have a problem i can't solve and i am going nuts... The thing is that i have a combo that has data. I clear the combo and put there new data, less than it had in the first place...

What happens is that when i open the combo, it appears all the data it had in the first place mas i can only choose the one's i put there. That means that the screen is not refresh, but the combo is... Can anyone help me to pass this stupid thing?? i just want to refresh the screen...

Thanks...

Tissa

Populating The Dropdown List Of A Combo Box
I have a combo box on a form that needs to have its dropdown list populated by approx 12,000 items. What is the most efficient way to do this? I have tried using an unbound box and additem but this is way too slow. (My list comes from a database, so I guess I should bind at design time??) Any advice would be appreciated.

I would prefer not to bind at design time, as the location of the db will change from time to time.

Substituting A ListView For A Combo's Dropdown List
Hi

The code below attaches the Listview1 to Combo1 of Form1. But it can't attach ListView2 to Combo2 of Form2. What i mean is, i want to attach any Listview to any Combo of any Form. So how can modify this code in such a way that will satisfy my requirement.

Please help me with this issue.



To a form, add a combo (Combo1), a listview control (ListView1), and three command buttons (Command1, Command2, Command3). Set the Style property of the Combo to Style 2, and add the following code to the form:


VB Code:
' Form Code' ======= Option Explicit Private bKeepOpen As Boolean Private Sub Form_Load()    Dim c As Long   Dim chd As ColumnHeader   Dim itmx As ListItem     'Add some dummy data to the listview and hide   With ListView1            Set chd = .ColumnHeaders.Add(, , "Name", 1000)      Set chd = .ColumnHeaders.Add(, , "Col 2", 1000)      Set chd = .ColumnHeaders.Add(, , "Col 3", 1000)      Set chd = .ColumnHeaders.Add(, , "Col 4", 600)            For c = 1 To 15         Set itmx = .ListItems.Add(, , Screen.Fonts(c))         itmx.SubItems(1) = "screen"         itmx.SubItems(2) = "font"         itmx.SubItems(3) = c      Next            .View = lvwReport      .FullRowSelect = True  'vb6 only      .BorderStyle = ccNone      .Visible = False            End With   'set inital state of command buttons   Command1.Caption = "hook combo"   Command2.Caption = "unhook combo"   Command3.Caption = "unhook && end"   Command1.Enabled = True   Command2.Enabled = False   End Sub  Private Sub Command1_Click()    If defWinProc = 0 Then      Hook Combo1.hwnd      Command1.Enabled = False      Command2.Enabled = True   End If   End Sub  Private Sub Command2_Click()   'unhook the combo   If defWinProc <> 0 Then      Unhook Combo1.hwnd      defWinProc = 0      Command1.Enabled = True      Command2.Enabled = False         End If   End Sub  Private Sub Command3_Click()    Unload Me End Sub  Private Sub Form_Unload(Cancel As Integer)    If defWinProc <> 0 Then Unhook Combo1.hwnd    End Sub  Private Sub ListView1_KeyDown(KeyCode As Integer, Shift As Integer)   'set flag to allow arrow and enter  'keys to simulate behaviour of normal  'combo   bKeepOpen = True End Sub  Private Sub ListView1_KeyPress(KeyAscii As Integer)   'set flag to allow arrow and enter  'keys to simulate behaviour of normal  'combo   If KeyAscii = vbKeyReturn Then           'simulate selecting item with enter      bKeepOpen = False      Call ListView1_Click   Else        'alpha or arrow keys being used,     'so keep open      bKeepOpen = True         End If      End Sub  Private Sub ListView1_Click()    Dim itmx As ListItem    If ListView1.ListItems.Count > 0 Then       Set itmx = ListView1.SelectedItem      'For a style 0 combo, you can not assign     'to the Text property from within the click     'event, so the selected item must be 'added'     'as the only combo item, and selected using     'its listindex property.     '     'For a style 2 combo, the text property     'can't be set unless there is an exact     'match to a list item, so again we fake it     'by adding the selection to the combo and     'selecting it.     '     'Finally, since the tabs can't be used     'in the combo's edit window, as it doesn't     'support tabstops either, on selection we'll     'display the main listview item      With Combo1         .Clear         .AddItem itmx.Text         .ListIndex = 0      End With    End If    If bKeepOpen = False Then      ListView1.Visible = False      Combo1.SetFocus   End If   End Sub



VB Code:
' BAS Module Code' ============ Option Explicit Public defWinProc As Long Public Const GWL_WNDPROC As Long = -4Private Const CBN_DROPDOWN As Long = 7Private Const WM_LBUTTONDOWN As Long = &H201Private Const WM_KEYDOWN As Long = &H100Private Const VK_F4 As Long = &H73 Private Declare Function CallWindowProc Lib "user32" _   Alias "CallWindowProcA" _  (ByVal lpPrevWndFunc As Long, _   ByVal hwnd As Long, ByVal Msg As Long, _   ByVal wParam As Long, ByVal lParam As Long) As Long Private Declare Function SendMessage Lib "user32" _   Alias "SendMessageA" _  (ByVal hwnd As Long, _   ByVal wMsg As Long, _   ByVal wParam As Long, _   lParam As Any) As Long Public Declare Function SetWindowLong Lib "user32" _   Alias "SetWindowLongA" _  (ByVal hwnd As Long, ByVal nIndex As Long, _   ByVal dwNewLong As Long) As Long  Public Sub Unhook(hwnd As Long)       If defWinProc <> 0 Then         Call SetWindowLong(hwnd, _                         GWL_WNDPROC, _                         defWinProc)      defWinProc = 0   End If    End Sub  Public Sub Hook(hwnd As Long)    'Don't hook twice or you will   'be unable to unhook it.    If defWinProc = 0 Then          defWinProc = SetWindowLong(hwnd, _                                 GWL_WNDPROC, _                                 AddressOf WindowProc)          End If    End Sub  Public Function WindowProc(ByVal hwnd As Long, _                           ByVal uMsg As Long, _                           ByVal wParam As Long, _                           ByVal lParam As Long) As Long    'only if the window is the combo box...   If hwnd = Form1.Combo1.hwnd Then         Select Case uMsg               Case CBN_DROPDOWN  'the list box of a combo                            'box is about to be made visible.                      'return 1 to indicate we ate the message            WindowProc = 1            Case WM_KEYDOWN   'prevent the F4 key from showing                           'the combo's list                        If wParam = VK_F4 Then                          'set up the parameters as though a              'mouse click occurred on the combo,              'and call this routine again               Call WindowProc(hwnd, WM_LBUTTONDOWN, 1, 1000)                           Else                          'there's nothing to do keyboard-wise              'with the combo, so return 1 to              'indicate we ate the message               WindowProc = 1                        End If                     Case WM_LBUTTONDOWN  'process mouse clicks                    'if the listview is hidden, position and show it            If Form1.ListView1.Visible = False Then                           With Form1                  .ListView1.Left = .Combo1.Left                  .ListView1.Width = .Combo1.Width                  .ListView1.Top = .Combo1.Top + .Combo1.Height + 1                  .ListView1.Visible = True                  .ListView1.SetFocus               End With                           Else                               'the listview must be visible, so hide it               Form1.ListView1.Visible = False            End If              'return 1 to indicate we processed the message            WindowProc = 1                  Case Else                    'call the default window handler            WindowProc = CallWindowProc(defWinProc, _                                        hwnd, _                                        uMsg, _                                        wParam, _                                        lParam)         End Select      End If  'If hwnd = Form1.Combo1.hwnd   End Function

Locking Dropdown Combo/list Boxes
I have developed an application in excel that requires an excel sheet to be locked prior to the user entering information into a custom form dialogue. I can lock the form so that users can not enter information into cells however combo boxes still function as normal (the allow selections). Is there anyway of disabling these objects to allow the sheet to be fully locked ?.

kind regards

Martin

Combo Box Not Displaying Dropdown List On 1st Click
Some of the combos on my application take a reasonably long time in returning the data. The delay isnt an issue cos it's trawling a massive database.

However, it seems the longer the delay the more likely that the list will not be displayed after just one click of the down arrow, but will require a second click once all the data has been retrieved.

The combos which are much quicker dont have this problem. Onc click and the dropdown appears.

Is there some kinf of issue with a large delay and is there any way of triggering the dropdown list manually at any point?

Any help much appreciated

Loading Report Names To Combo Box (dropdown List)
I created some code to add the names of the reports to a dropdown so that the user can select the report.

This worked the first time. However, ever since, I am getting 2 copies of the reports. This gets even more wierd. If I now add create a new report, the next time the form loads, the combo updates with just one copy of the report, but still with 2 copies of the old reports.

I have closed access and rebooted, to no avail.

Here is my code:

Private Sub Form_Load()

Dim obj As AccessObject, dbs As Object
Set dbs = Application.CurrentProject
' Search for open AccessObject objects in AllReports collection.
For Each obj In dbs.AllReports
cmbReports.AddItem obj.Name
Next obj


End Sub

Finding Most Common Item In A List?
Is there an easy way to find out what the most common item is in a list?

What I essentially want to do, say I have the following list:


Bear
Fox
Wolf
Squirrel
Fox
Fox
Wolf
Horse


I'd like to run the function and have "Fox" come back, as it appears 3 times. If it was a tie between two (Say Wolf had one more), it would return the first found occurance.

Is there any easy way to do this? Thanks.

Create A Property Window Dropdown List AKA Listbox List/ItemData
I'm trying to create an enhanced listbox control (in VB6) and one of my main criteria is to make it funtion very similarly to the standard listbox control.
Creating dropdown lists of constants (i.e. the Style property) is easy enough. but I haven't been able to re-create the ability to add (array) items in the property window such as is possible with the standard Listbox List and ItemData properties.
Anyone know how (or if) this can be done in VB6?

Regards

Ant

Excel - Dropdown Showing List 2 Dependant On What Was Chosen In List 1
I'm programming VB in Excel. I've created a series of simple lists in a worksheet. I would like to select one object from list 1 in a cell in column A and then have the cursor cell move to the right neighbouring cell and present me with a dropdown menu showing the contents of another list dependant on what was chosen in the first cell. Is there a specific command for this?

Many thanks for any help.

Combo Box, Item Not On List
Hi,

How can I prevent the message " Item does not exist on the list" from appearing? I am using the not-in-list event to perform a procedure and I only want my message to appear. Using Docmd.CancelEvent has not helped me. Any suggestiong?

Thanks

Finding The Handle Of A Combo-box List.
^^^Anyone know how to do this? I can get the handle of the combo-box itself, but I need the handle of the drop-down list to obtain x/y coordinates. Since the form is sizable/movable (and the child handles change everytime the application is launched so Spy++ is out of the question) I have to find this info every time the button is clicked. Just for kicks, here's snippets of my code.

***WARNING: it does a lot of switching from form to module to different module and back to form so if it's confusing, I'm sorry.***

Code:
'This is on the form
Option Explicit
Private Sub cmdGo_Click()

Dim hParent As Long
Dim FilterHandle As Long
Dim FilterListHandle As Long
Dim ReportHandle As Long

Dim FilterName As String
Dim ReportName As String
Dim FormatType As String
Dim Results As String
Dim Results1 As String
Dim FilterIndex As Long
Dim ReportIndex As Long
Dim FilterIndexCount As Long

Dim WaitString As String

Dim x As Integer

Me.AutoRedraw = True

hParent = FindWindow(vbNullString, "Open Claims")
ShowWindow hParent, SW_SHOWNORMAL
SetForegroundWindow (hParent)

FilterHandle = Find_Filter
FilterListHandle = Find_FilterList
ReportHandle = Find_Report

x = 0
Do Until x = (GetComboCount(FilterHandle) - 1)
FilterIndex = SetComboIndex(x, FilterHandle)
FilterName = GetText(FilterHandle)
If FilterName = "Texas Inventory Over 5 Days" Then
Results = FilterName
Exit Do
Else
x = x + 1
End If
Loop

If ComboDropped(FilterHandle) = False Then OpenComboList (FilterHandle)

CenterLeftClickDownFilter (FilterListHandle)
CenterLeftClickUpFilter (FilterListHandle)

Sleep 5000

CenterLeftClickDown (ReportHandle)
CenterLeftClickUp (ReportHandle)

Do Until ReportName = "Report In Excel"
ReportName = GetText(ReportHandle)
If ReportName <> "Report In Excel" Then SendKeys "{down}"
Loop

End Sub
Here are all the functions being referenced in the above code:

Code:
Function Find_Filter()

Dim Win_Buff1 As Long
Dim Win_Buff0 As Long
Dim sddx As Integer

Win_Buff1 = FindWindow("ThunderRT6FormDC", "Open Claims")
If Win_Buff1 = 0 Then Win_Buff1 = FindWindow("ThunderRT6FormDC", vbNullString)

Win_Buff0 = findchildbyclass(Win_Buff1, "ThunderRT6ComboBox")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "All Open Inventory")

Win_Buff0 = GetWindow(Win_Buff1, GW_CHILD)
For sddx = 1 To 17
Win_Buff0 = GetWindow(Win_Buff0, GW_HWNDNEXT)
Next sddx

Find_Filter = Win_Buff0

End Function
'-------------------------------------------------
Function Find_Report()

Dim Win_Buff3 As Long
Dim Win_Buff2 As Long
Dim Win_Buff1 As Long
Dim Win_Buff0 As Long
Dim sddx As Integer

Win_Buff3 = FindWindow("ThunderRT6FormDC", "Open Claims")
If Win_Buff3 = 0 Then Win_Buff3 = FindWindow("ThunderRT6FormDC", vbNullString)

Win_Buff2 = findchildbyclass(Win_Buff3, "AfxWnd40")
If Win_Buff2 = 0 Then Win_Buff2 = findchildbytitle(Win_Buff3, "")

Win_Buff2 = GetWindow(Win_Buff3, GW_CHILD)
For sddx = 1 To 16
Win_Buff2 = GetWindow(Win_Buff2, GW_HWNDNEXT)
Next sddx

Win_Buff1 = findchildbyclass(Win_Buff2, "ThunderRT6ComboBox")
If Win_Buff1 = 0 Then Win_Buff1 = findchildbytitle(Win_Buff2, "Report In Excel")

Win_Buff1 = GetWindow(Win_Buff2, GW_CHILD)
Win_Buff0 = findchildbyclass(Win_Buff1, "Edit")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "Format A - Report")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "Format B - Report")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "Format C - Report")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "Format D - Report")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "Report In Excel")

Win_Buff0 = GetWindow(Win_Buff1, GW_CHILD)
Find_Report = Win_Buff0

End Function
'-----------------------------------------------------
Function Find_FilterList()

Dim Win_Buff1 As Long
Dim Win_Buff0 As Long
Dim sddx As Integer

Win_Buff1 = FindWindow("#32769", "")
If Win_Buff1 = 0 Then Win_Buff1 = FindWindow("#32769", vbNullString)

Win_Buff0 = findchildbyclass(Win_Buff1, "ComboLBox")
If Win_Buff0 = 0 Then Win_Buff0 = findchildbytitle(Win_Buff1, "")

Win_Buff0 = GetWindow(Win_Buff1, GW_CHILD)
For sddx = 1 To 2
Win_Buff0 = GetWindow(Win_Buff0, GW_HWNDNEXT)
Next sddx

Find_FilterList = Win_Buff0

End Function
I'll post the rest of the functions on the next post so that I don't accidentaly for over the post limit....

Adding Item To Combo Box List Property Permently
guyz is there any way i can add data to combo box list property in vb 6. using a text box and command button and add it to the list property permentaly so when the form loads again then that data should be in the combo box

i hope you understood me

for example

in design time in vb6 you create combo box then you selected list property and enter some data in the list

then create command button & textbox

then use textbox & command button to add data from textbox to combo list property permentaly so when form load again that entered data should be in the combo box

please help me if you know how to crack this problem

thank you in advance

Getting A Combo Box List And Putting It In A List Box List On Another Form
I am finally writing my first MDI! I'm doing a lot better than I thought I would so far, but now I'm stuck. I need to have a list from a combo box copied into a list box on another form. I want it in the Form_Load() event. Right now I have:

Code:Private Sub Form_Load()
frmpresetedit.deletepreset.List = frmtimer1.cmbpresets.List
frmpresetedit.Show
End Sub

deletepreset is the list box, cmbpresets is my combo box.
It always comes up with a compile error at the .list part of cmbpresets.list and says that 'the argument is not optional'. What is my problem here? I'm sure this problem is simple and I'm probably just making a stupid mistake. What code do I need to use?
Thanks


Now, don't get me wrong, 'cause baseball's a great sport.
It teaches little children simple eye-hand coordination with little effort or exhaustion.

 -byufan

Edited by - byufan on 7/20/2004 4:20:57 PM

Combo Box Dropdown List Width, Setting The Width *RESOLVED*
I found a way of changing the width of the dropdown list of a combo box by subclassing it. Is there any other way to do it? Can I subclass two seperate combo boxes in the same form or would it cause a problem (there seems to be when I tried it)?

Thanks

Create List Of Files From Folder But Allow Double Click On List Item To Run Bat
I am a newbie
But am making some progress
My next plan is to make a simple dialog with a list box and 3 buttons to do the following
List all the batch files in a folder
then allow me to highlight one item in the list so when I click the button it will run that bat file.

Sounds easy enough but I just keep hitting a brick wall and am not making any progress at all.

All help or similar snipits of code that I can re-organise will be greatfully apperciated.

Thanks in advance

HighLight List Box Selected List Item With User Defined Color
Hi Friends,

I need a help from u all. My problem is to change the Backcolor of the selected listitem of a listbox.

Let me explain detail. Normally in a listbox if we selected the list, the list item will be highlited with blue backgroud (ie. the selected item color settings of the system). Now I need to hightlight the selected list in the list box with my own color say red, green or something else.

Would anyone help me.

V.P. Vijayavel

How To Change Back Color Of List Item In List View
Dear members,

i am having small problem with listview control , I want to assing alternate colors to list items, but i con't,

hope someone will help

regards
D.L.Narayana

Limit An Input Length For Style - DropDown Combo
Anyone know how to put a max length for a combo list box of Style -> 0 - Dropdown Combo ??

Menu And Submenu Style In A Dropdown Combo Control?
Hi, I have a combobox with over 100 items which is inconvenient for a user to choose an item. So I would like to group the items into several groups and just put group name into combobox list, whenever user click the group name, I hope another temporary window pups up beside the dropdown list to show all items in that group. Can I do it? Thank very much for your help!

ListBox - Move List Item To Place In List
I have a list box with several items. I am trying to make a button that when the user selects an item in the list box, they can click on the button which will move the item up one in the list box:

So if my list looked like this:

ONE
TWO
THREE
FOUR
FIVE

and the user selected FOUR and clicked the button the list would look like this:

ONE
TWO
FOUR
THREE
FIVE


Does anyone know how to do this?

Thanks,
M

Combine List Items To Create New Item In Same List?
Hi all,

This has been giving me fits for a few days - any help would be most appreciated. I'm sure it's pretty simple, but I'm new to VB (and programming in general) and can't seem to come up with the correct syntax to get this to work:

I have a listbox from which the user can select mutliple items. Once user performs a multi-select, I enable a button (no problem there). When user clicks that button, I want to create a new item in that same list consisting of all selected items with "AND" between them.

Thus, if user had selected <item 1>, <item 2>, and <item 4>, the new item would be "<item 1> AND <item 2> AND <item 4>". Can someone please help me with the logic and syntax on this?

Here's what I have up to this point (I've removed the parts that I believe - based on the fact that this is not working - to be wrong and replaced them with ?????):

Code:
        Dim terms As String
        For Each terms In List.SelectedItems
            If List.SelectedItems.Count > 1 Then
                terms = ??????? & " AND " & ???????
            End If
        Next
        List.Items.Add (???????)


Thanks!!



Edited by - troy_atl on 10/17/2005 12:04:26 PM

Change Background /Forgroound Of Each List Item In A List Box
How would i be able to change the back color of a listitem in a list control ? For example i want item number 1 to have a red background item number 2 to have a blue background etc.
Thanks for the help

Jerry

Finding The Maxiumum Of A List Of Numbers In The List Box
Ok, I need help finding out how to write the code for a label to show the minimum or maxiumum of the numbers in the list box. The list box has a list of temperatures in it; and the label needs to have the maxiumum temperature (corresponding label have the miniumum temperature). The number is a single, with 4 decimal places.

Thanks

-Ryan

Check List Style List Box
Does anyone know how to determine if a certain item in a list box is check if the listbox style is set to Check List.
Screenie:

Thanks in advance

Add A List Item To A Loaded Form List
help please. this is probably very simple.

i have a form loaded and showing. i need to add items to a list box, and my code is in a public sub in a different module.

my code follows. i wind up getting an "object doesn't support this type of property..."

i feel like i am close, i just don't seem to be referencing the form list correctly.

thanks much!

Public Sub BuildOverviewList()

Dim dbSOURCE As Database
Dim dbTARGET As Database
Dim rsSOURCE As Recordset
Dim rsTARGET As Recordset
Dim strDatabase As String
Dim strTable As String

strDatabaseName = "ProductCategories.mdb"
strTableName = "tblCurrentPresentation"
Set dbTARGET = OpenDatabase(dbPath & strDatabaseName)
Set rsTARGET = dbTARGET.OpenRecordset(strTableName, dbOpenDynaset)

'aryProductGroup provides the selected categories
For i = 1 To UBound(aryProductGroup)
'aryCategory1
For j = 1 To UBound(aryCategory1)
If aryCategory1(j) = -1 Then
strDatabaseName = "Category1_information.mdb"
strTableName = "CategorySlides"
Set dbSOURCE = OpenDatabase(dbPath & strDatabaseName)
Set rsSOURCE = dbSOURCE.OpenRecordset(strTableName, dbOpenSnapshot)
'write the record to the target table and add to list1
'USE THE ARRAY POSITION (j) TO GET THE SLIDE NAME FROM THE CORRECT TABLE
'ADD THAT SLIDE NAME TO THE LIST.
With rsSOURCE
rsSOURCE.Move (j)
With rsTARGET
.AddNew
![StepID] = 4
![CategoryID] = aryProductGroup(i)
![ProductID] = j
![Name] = rsSOURCE.Fields("SlideName").Value
.Update
End With
'Forms.frmPresOview6.List1.AddItem rsSOURCE.Fields("SlideName").Value
Forms.frmPresOview6.List1.AddItem rsSOURCE.Fields("SlideName").Value
End With
'also add record to ProductCategories/tblCurrentPresentation
End If
Next j

Next i

Activex Controls For List Box, List View & Combo Box (for Storing Arabic Language)
Hi all,

Can any one having controls (list box, list view , combo & date
picker ) with right alignment. i.e scroll bar should come in left side
instead of right...simalry drop down for combo box should be in left side
instead of right side.

This i need for storing Arabic data...

Thnaks
Sridhar CS

What Is The Limits On COmbo Box, List Box And LIst View And How Do You Handle Situations W
OK<
I have looked at all 5 of my vb Barnes and noble books
under listbox
and did not find where it said what the limit was.

I learned how to read a data base (unbound even) into a list box, or combo box.

But now I have over 32,768 items,
my data base list has between 100,000 - 125,000 Parts I want to load.

I can think of a lot of cases where the data base you want to load into a list or combo box is well of 32768


So my questions are
( I did also search VBCITY)

1) What is the limits on
listbox
combo box
list view

and

where is it documented.

and 2

How do I handle the case of more than 32768 with a listview??

I did found a little bit about it on vbcity

Thanks



 

Teams List And ID's List On Combo Box And Label1.caption
Hello there, how are you guys doing?
I've got one problem, i dont know how to, basically finish my project which need to have this implented:

I have file called "teams.ini" in which there are like 2500 lines, here are few samples:

Juventus,23
Real Madrid,33
Arsenal,66
Newcastle,55

and so on... what i want is to show Team name in Combo Box(ex. Juventus) and i want it's id (ex. 23) to be show on the label1.caption, and that for all the teams, there are arounf 2500 teams with it's ID afterr comma.

I hope someone can help me with the code (if its not that complicated code)

Thanks alot!

How To List The Items Of Combo List When It Get Focus Without Click On It
Hi:
Here I have problem, I have a Combo list. If the user don't want to use mouse, and She want the Combo list list all of of it's item just like mouse click on it when she use TAB to focus on it. How can I implement this function. If anybody know about it. It will be very helpful
Millions of Thanks.


wky086

Make The First Item In A Data Combo Box Appear Without Pushing The Dropdown
I have a data bound combo box that is returning selected data to the user. My boss wants the first element to show up without the user having to click on the down arrow exposing all the selections in the box. Is there any way to this in code. I will appreciate any help.
Thanks

Copyright © 2005-08 www.BigResource.com, All rights reserved