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




Moving ListBox To Typing Position.


Hey,

I have a question for you that seems to me as if it could be a hard one... I have not been able to find anything about it, mainly because I haven't got a clue as to where to look for...

I made some sort of AutoComplete feature in my program (in a RichTextBox), and it would be really nice if I could make it similar to Visual Basic's "Auto List Members" option (which is the listbox popping up with possible keywords when you type a ".")

I want a ListBox to become visible whenever the program is autocompleting a word, that lists all other possible keywords (because there are often multiple).

I want this ListBox to appear at the location of the I-beam (selection thingy).

How can I get it to move there? Is it possible to find the Top and Left location of the I-beam inside a RichTextBox somehow? I doubt it...
Can it be done otherwise?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Typing Cursor Position
hey whats up yalll?
iam try to make a HTML editor...but iam trying to insert some tags by letting the user click on menus
eg: if user clicks on <html> tag menu
it will insert this tag in the place where the typing cursor is ??
but i dont know how to do this...
i tried richtext1.seltext = <html> but that doesnt work
did a search and found nothing
i think i will need some API or something....help plz

Typing Position In Terms Of X And Y
Say Im typing in a rich text box. I hit "z" and a form pops up. Thats easy. But how do I make the form load so that the left of the form is exactly the left of the letter "z" and the top of the form is exactly the bottom of the letter "z".

Cool Things~Any Body Teach Me How To Control The Mouse Moving By Typing The X And Y?
I would like to know if anybody know how to controal over a mouse by using typing the x and y it will automatic go to the direction and i press cmdleft
button it will click on the define object and i press cmdright it will also will virtual what the mouse do with the right click.
x and y is the destination.

Typing In Listbox
Say I have a question,

In one part of my project I have a listbox that when you click in it you can type to find what you're looking for.
For example if I had a listbox with a lot of names in it and I wanted to find the name "Dulsey" I could click anywhere in the listbox and then type D U L and it will take me right there.

Now I have listboxes in other areas of my project that simply don't behave the same way. I looked at the properties and can't really find a way to control that. I know I missed something simple somewhere. Any ideas?


THanks

Max.

Listbox Select By Typing **RESOLVED**
Is there a way to make a listbox so that the user can quickly type the first few characters of the item they want and it is automatically selected? It sems the listbox works for the first letter, but for the first letter only. I'm sure this has been asked before but I can't seem to find anything. Thank you.

Searching A Listbox By Typing In A Textbox
How can I search a listbox or a combobox by typing text in a textbox? I have found an answer in the tips section of http://www.allapi.net but you can only type the first character.

HighLight A Listbox As Typing In A Text Box
email me and or answer here or both Thanks!!!

I have what should be an easy problem.

I am not sure if I should you use a combo box in list state ro a text box and a list box

I fill a listbox with about 100,000 items, from one field in an MDB Database.
So that list is static at that point with a Scroll bar

As the user types in a text box above, I want the list to not only move up and down the the closes selection that starts exactly with what is being typed, but when I want the closest item in the list to also highlight so the user can just press enter.

If I use a combo box in list state, the list combo lists slides up and down just fine, but the item does not highlight. The user has to use the mouse to click on the item, plus while looking at the scroll bar as it slides up and down on the 100,000 items, and the list box displays about 10 items at a time, It is hard for the user to see the best match.

For Example

in the text box ( or Combo) the user knows the entery they are looking for, so they start typei

P101-a2

The list might show this

L1010
M23456454
N95039-123
P13452456
P15
P101-aaa54
P101-a2567 (This ONe should Highlight with what is typed above)
P101-a5
P101-btyt
Tdfdgdf
Tdfadfg

The list of 100,000 enteries slides up and down fine if I use a combo box

But the User instead has to mouse click instead of just pressing enter, because they can see the one they want is already highlighted, so why should they have to type more.

Please let me know if you have a recommendation
Should it be a text box and a list box,
a combo box,
or some other control,
and what could would I use.

Thanks

 

Moving The Position Of Another App Using VB
Hi,
I came across this application called WinTailor it allows the user to click on like an application window and move it to coordinates that you want on to your screen. Its similar to spy++.

You could have a look at it here:
http://www.codeproject.com/wtl/wintailor.asp

Was wondering if you could do the same with a VB app by using a Hwnd property? Like creating a vb program to move outside program windows. What would be a good way to do it?

Moving The Mouse To Position X,Y
I know there is a simple way to move the mouse to any position on the screen in vb. A search brought up nothing specific to what I am trying to do. Basically, I have two textboxes on a form to represent x and y. When I click a command button, I want the mouse to move to position x and y. Any hints?

Moving Mouse Pointer To The Specified Position
Hi there!

How could I move my mouse pointer to the control (button) which has got focus? Like if the user changes focus from the Command1 to the Command2 with the TAB key the mouse should move there too.

Any idea?

Moving X2 Position Of Line On Mouse Click
Hi all,


How do I move the position of X2 only on a line, when the user clicks it and drags it to where they want it to be?

Moving Listbox Item To Another Listbox
hi does anyone know of an easy way to move an item in a listbox to another listbox, lets say a source and target listbox and vice versa. thanks

Listbox To Listbox File Moving
I am working on an application where I want to present a current file's field list in one listbox and let the user Click once to highlight it and click a command button to move it from that listbox to another one (for processing). When moved I want it to be gone from the first list and present in the second. Similarly, I have another command button that does the opposite. Can someone give me some ideas of how I actually do this?

ListBox Items Position
hello,
In a list box, I want the user to be able to drag the items and change there positions, u just click on any item and move your mouse downward and the item moves downward... same thing for moving upward...
any help?

Listbox Position Question
I have a listbox with:

Steve
John
Kara 1
Bridget 1
Sam 1

I need to add a new name between the name without the 1 and with the 1.

how can I loop through the listbox and find that position and and add the new name in that spot.

thanks

Listbox New Item Position
If I have a listbox with 15 items and i wanted to add a new item in position 9, how could i do that?


thanks

Mouse Position Over Listbox?
Hi,

Sure this has been asked many times before but I've done the search and not found the answer (well, not that I recognise!) so...

I have a list box and the user wants to be able to edit the comments, so I've created a new form that pops up when they double click etc. However, I'd like the new form to appear directly over the item they clicked on (and not just in the center of the screen or something), so how do I get the position of the selected item?

Cheers!

Change The Position Of The Iteam In Listbox
How can change the position of the iteam in the column of listbox ( to below or to above )

Moving Listbox??!!
ok, how do i make an item in a listbox (List1) move into another listbox (List2) after i have selected the item and the pressed a command button. For example: In listbox1 i have an item that says "Hello" then i select it and click the command button then "Hello" moves it from listbox1 into listbox2 and is no longer in listbox1 any more. How do i do this please help!!

Thank You.

Moving From One Listbox To Another
I am currently moving items from one listbox to another the normal way with a loop. However, there can be up to 15,000 records that are moved at one time. Is there an API call that will move all records from one listbox to the other more quickly and efficiently?

Search/Position Top Value Multi Select Listbox
Hi I'm sure this has been covered before but can't seem to find anything.

I am trying to perform a listbox search upon entry to a textbox, however rather than highlighting the nearest match I only wish to set the top viewed item to be the nearest match. It is a multi select listbox and want to offer this functionality only as an aid to avoid having to scroll through the thousands of items i have in the listbox.

I've found several threads that use an API to search and select an item but can't figure out how to just set the top viewed item.

Help greatly appreciated cheers

Move TextBox To Listbox Item Position
I have a list box with checkboxes., with say 10 items in the list.

I need to edit the item contained on a particular list box item.  ie....I click on the check box in item 3.

Private Sub List1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
Text1.Move X, Y
End Sub

This does move the text box to the 3rd line of the list box
but not the horizontal position.

I would like to get the text box directly over the list box item., so i can type in the altered info and then place this data in the list box (ie replace)

Appreciate any ideas of how to do this


Listbox Scrolling Moves Recordset Position
Hi,

I have this problem of having my recordset changing positions while i scroll the list box using up/down arrows.

Please help. This is how I setfocus to the list box...

CODEWith List1
                .Clear
                 adoTmpRS.Open "select * from m_Ac order by ac_name", db, adOpenStatic, adLockReadOnly
                 For i = 1 To adoTmpRS.RecordCount
                     .AddItem adoTmpRS!ac_name
                     adoTmpRS.MoveNext
                 Next i
                 adoTmpRS.Close
                 .Text = grdDataGrid.Columns(ColIndex).Value
                 .Left = grdDataGrid.Columns(ColIndex).Left + 125
                 .Width = grdDataGrid.Columns(ColIndex).Width
                 .Top = grdDataGrid.Top + grdDataGrid.RowTop(grdDataGrid.Row) + grdDataGrid.RowHeight
                 .Visible = True
                 .SetFocus
             End With

Moving Items Up And Down In A Listbox
I just solved this question that I've had for a while.

Thought I'd share the code.

http://cornempire.newezone.com/resou...e/listmove.htm

Moving Items In A Listbox
Hi, I have a listbox, with the following:

[case 1]
Msg "Hello"
[case2]
msg "hello"

You can place these items on another dialog.
but, I need it to look like:

[case1]
Msg "hello"
... ---->Open a new space for more Messages when you place one.
[case2]
Msg "hello 2"

This is the code I have so far, but it isnt working.


Code:
Private Sub Command1_Click()
Dim newe As Integer


newe = Newevent.EventList(Eventnum).ListCount
Newevent.EventList(Eventnum).AddItem "<Msg>: " & Text1.Text, newe
'This bit is OK, places the message.

If Newevent.EventList(Index).Text = "..." Then
Newevent.EventList(Index).List(Newevent.EventList(Index).ListIndex) = "..."
Newevent.EventList(Index).List(Newevent.EventList(Index).ListIndex) = "<Msg>: " & Text1.Text
'Only one thing to happen for a Case
'Need it so you can have more than 1 Message under
'case 1, case 2,etc... (Move every ListItem down 1?) -Chris

Dim Position
For n = Newevent.EventList(Index).ListCount To Position + 1 Step -1
Newevent.EventList(Index).List(n) = Newevent.EventList(Index).List(n - 1)
Next
Newevent.EventList(Index).List(Position) = "..."
End If
Exit Sub

Unload events
Unload Me

End Sub

Private Sub Command2_Click()
Unload Me
End Sub

Any help would be appreciated

Chris

Moving Item From One Listbox To Another
Hey all

I am trying to move an item from one listbox to another. The first listbox has items where the RowSourceType = "Field List" and the second one is value list. This is my code:

Private Sub DisplayAllFields_DblClick(Cancel As Integer)

If ListOfFieldsSelected.RowSource = (List0.Value & "." & DisplayAllFields.Value) Then
MsgBox ("You cannot select a field more than once. Please select another field")
Else
ListOfFieldsSelected.AddItem (List0.Value & "." & DisplayAllFields.Value)
End If
End Sub

When I double click the same value in the first list again, it brings up the msgbox once but it doesn't do that once it has added another field to ListOfFieldsSelected. I would use the RemoveItem method so user can't click the field again but DisplayAllFields is set to Field List so it can't remove item unless set to "Value list". Any suggestions on this?

Any help will be greatly appreciated.

Many thanks

Rupa

Moving Items In Listbox
im trying to get items in a list box to move up and down im not sure how to do it i dont have the first clue wot to do can anyone help with the code?

Moving Listbox View
After picking an item in a Listbox, I want to return it to the top of the list. using listindex just selects an item, but doesn't return whats shown to that item. I want it to display item 0.
How do I accomplish this?
I had:

Code:
ListBox1.ListIndex = 0

but it just highlights the item, but does not show it.
i'm showing one item at a time, and scrolling to the picked item.

Listbox Moving Listindex
i have this code to select the next listindex and if its at the end start at the beggining again.

VB Code:
List1.ListIndex = (List1.ListIndex + 1) Mod List1.ListCount


my question is can anybody come up with a line like that but make it go backwards.
i know you can do if statements to check where the index is but i have been trying to figure this out and i just cant get it right.

thank you.
casey.

Moving ListBox Items
Could anyone tell me how to write a sub that allows you to click and drag an item in a listbox to a new index position within the listbox?

Ash

Moving Items In A Listbox
I have a listbox that has several items in it that i want the user to be able to move up or move down. I have two buttons, one for up the other one for down. Anyone know how to do this? Thanks!

ListBox, Moving From First Item To Second And So On
Hey, im working on a media player, the media player works great but the playlist is screwey! Im having troubble with this:

You select an item for play - 100% ok
it plays it - 100% ok
it then goes to the next item on the list - BUGGY!

it wont move to the next item and when it does, it wont update the selected item eg, it will play the next item then when thats done it will play the one before that not the next on (constant loop between two files). Please help

Moving Items In Listbox Down
This code is supposed to move items down 1 spot within the list box with the push of a cmdbutton. I got it to move one item at a time down, but ideally it should move multiple items down at the same time. Any ideas or suggestions would be greatly appreciated. Thank you.

Private Sub cmddown_Click()
Dim Temp As String, Item As Integer

Item = lstShopping.ListIndex

If (Item &gt; -1) And (Item &lt; lstShopping.ListCount - 1) Then
Temp = lstShopping.List(Item)
lstShopping.RemoveItem Item
lstShopping.AddItem Temp, Item + 1
lstShopping.ListIndex = Item + 1
End If
End Sub

Archie Kantzavelos

Moving Listbox Items W/ Mouse
does anyone know how to shift listbox items around with the mouse? a good example would be winamp's playlist. the code i came up with works fine...if you move your mouse slowly. if you go fast, it'll pretty much mess up the order because the cursor jumps around when you move your mouse too quickly.


Dim HotItem1 As Integer

Private Sub List1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = 1 Then
If HotItem1 <> List1.ListIndex Then
If HotItem1 > -1 Then
a = List1.List(HotItem1)
b = List1
List1.List(List1.ListIndex) = a
List1.List(HotItem1) = b
End If
HotItem1 = List1.ListIndex
List1_Click
End If
Else
HotItem1 = -1
End If

End Sub

Moving Text From Textbox To Listbox
I'm trying to move text from a multiline textbox [Text1] to a list box [List1] but I cant seem to get it :-( Here's what I've done so far.... The code skips some lines. Any help will be appreciated. TIA


Dim CurrStart As Integer
Dim Temp As String 'temp buffer
CurrStart = 1
Temp = Text1 'save text1 to temp
While InStr(CurrStart, Temp, vbCr)
    CurrStart = InStr(CurrStart, Temp, vbCr) 'find the newline
    List1.AddItem Left(Temp, CurrStart) 'add this line to listbox
    Temp = Right(Temp, Len(Temp) - CurrStart) 'remove this line from temp
Wend

When Moving Item Down In The Listbox The Text Disappears
Okay dont know why but the text is dissapearing when an item is moved down the list box.

Image1 displays before the move down
Image2 displays after the move down
Code is also attached. I am very confused I have been through this code througherly and I am sure there is not an error in the code.




Code:
' check: only proceed if there is a selected item
' check: last item can't be moved down
' save items text and items indexvalue
' remove item
' place item back on new position
' if you keep that item selected
' you can keep moving it by pressing cmdDown
' for arLoopCount adds the new playlist entrys from
' lstPlayList.
' list1 refreshes
' lstPlayList refreshes
Dim tempStr As String
Dim iIndex As Integer
Dim arLoopCount As Integer
List1.Clear ' Debugging orriented object to display the contents of arFilePlayList Array
If lstPlayList.SelCount = 1 Then
If lstPlayList.ListCount - 1 = lstPlayList.ListIndex Then
Exit Sub
Else
tempStr = lstPlayList.List(List1.ListIndex)
iIndex = lstPlayList.ListIndex
lstPlayList.RemoveItem lstPlayList.ListIndex
lstPlayList.AddItem tempStr, iIndex + 1
lstPlayList.Selected(iIndex + 1) = True
End If
End If
For arLoopCount = 0 To lstPlayList.ListCount
arFilePlayList(arLoopCount) = lstPlayList.List(arLoopCount)
List1.AddItem arFilePlayList(arLoopCount)
Next arLoopCount
List1.Refresh
lstPlayList.Refresh

Simple! Moving A Listbox Item For One Lsitbox To Another.
How can I move an item from

lstbox 1 ---> lstbox 2

I want the item to be removed from lstbox 1 and added to lstbox 2

Thanks for anyone who helps.

Problem Moving Listbox Horizontal Lisbox Scroller To The Right
Hi all i put a horizantal scroller for mylistbox but unfortuntally i can not use it sicne i have long data in my listbox and i can not move the tab for the horizantal listbox since the with of is big enought that does not allow any movment to right side!! Even if i try to make my listbox width big still i face problem. Is there a way to make the size of scroller tab smaller so i can move it to the right side ? I hope some one help me here.Thanks



VB Code:
Private Declare Function ShowScrollBar Lib "user32" (ByVal hwnd As Long, ByVal wBar As Long, _ByVal bShow As Long) As LongPrivate Const SB_HORIZONTAL = 0

Multiple Listbox Scrolling, Matching Position + "lag"
Today isn't my day

Anyway...i have 3 listboxes in my program that should all have the same listindex at the same time...which works fine BUT the scrolling lags the first time you scroll down and if you pull down one scroll bar of any list and then click on an item in another list or the same lists the lists don't match up anymore...what i mean is visually...they still all have the same listindex it just doesn't look good when one selection is in the center and 2 others are at the top...i hope you get what i mean, if you want to try it yourself just copy this code into a new project and add 3 listboxes:


Code:
Private Sub Form_Load()
Dim i As Integer
For i = 1 To 30
List1.AddItem i
List2.AddItem i
List3.AddItem i
Next i
List1.ListIndex = 0
End Sub

Private Sub List1_Click()
List2.ListIndex = List1.ListIndex
List3.ListIndex = List1.ListIndex
End Sub

Private Sub List2_Click()
List1.ListIndex = List2.ListIndex
List3.ListIndex = List2.ListIndex
End Sub

Private Sub List3_Click()
List1.ListIndex = List3.ListIndex
List2.ListIndex = List3.ListIndex
End Sub
yeah i know thats ugly code but it's enough to get the idea...
i hope someone can help me with this

- Fix lag the first time a box is scrolled(maybe "prescroll it ?)
- Visually align all listboxes correctly

thanks in advance

How Would I Position My Form At The Current Caret Position (like The Menu For Inserting Stuff In Msv
How would i position my form at the current caret position (like the menu for inserting stuff in msvb6)

Dragdrop Moving Wrong Item In Listbox(aborted Dragdrop Idea)
I am using dragdrop in a list box(checkbox style) to move items around but sometimes it picks up the item below the one I selected instead of the one I clicked on. ANy ideas? heres the code I'm using

Code:

Private Sub lstFields_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Button And vbLeftButton) = vbLeftButton Then
nDragIndex = Y Me.TextHeight("Xyz")
If nDragIndex >= 0 And nDragIndex < lstFields.ListCount Then
blnDraging = True
End If
End If
End Sub

Private Sub lstFields_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim nIndex As Integer
Dim sItem As String

If (Button And vbLeftButton) = vbLeftButton Then
If blnDraging = True Then
nIndex = Y Me.TextHeight("Xyz")
If nIndex > lstFields.ListCount - 1 Then
nIndex = lstFields.ListCount
ElseIf nIndex < 0 Then
nIndex = 0
End If
If nIndex <> nDragIndex Then
sItem = lstFields.List(nDragIndex)
lstFields.RemoveItem nDragIndex
lstFields.AddItem sItem, nIndex
End If
End If
blnDraging = False
End If
End Sub


This is my first post with code in it so I hope I did it right, sorry if I didn't.

Sunflower Queen

How Can I Position ChildMDI In Centre Position Of ParentMDI
How can I position my ChildMDI form in the centre of my ParentMDI form.
And further more, how can I pass form variable (eg. text box entry, radio button selection) from one MDI form to another. Or one form to another. like one shown in picture attached. The sample output is derived from the previously filled form. How to pass these variable?

Row Position, Column Position Of Cursor In RichTextBox
I am trying to create a text editor with some enhanced specific features for my application. One of these features which is a MUST is that I need to know which row and column my cursor is on at any given time. Therefore if I use the arrow keys, or click on the RichText Box, I can update the statusbar to tell me which line number (row) and character position within the line I am on.

I am not totally sold on using the rich text box, but the files can be somewhat large, and I need the text to be editable.

How Can I Position ChildMDI In Centre Position Of ParentMDI
How can I position my ChildMDI form in the centre of my ParentMDI form.
And further more, how can I pass form variable (eg. text box entry, radio button selection) from one MDI form to another. Or one form to another. like one shown in picture attached. The sample output is derived from the previously filled form. How to pass these variable?

Code For Moving To The First Blank Cell In A Worksheet; Moving Left,right,up Or Down
I have created an application form as a userform in Excel. I need to send the data entered into my text boxes when the program runs to separate excel cells in a worksheet.

My problem is I can use code that will send the textbox entry to a specific cell eg. If my textbox is named Surname I can say

range("a5").value = surname but if I do that when I run the programme to enter the next record for someone else the first record will be overwritten.

I NEED A CODE LINE THAT WILL TAKE ME TO THE FIRST EMPTY CELL AND ALLOW ME TO MOVE DOWN OR TO THE LEFT OR TO THE RIGHT

Self-Typing
How would I make my program type things? Such as, going to another window (like Word) and typing things that I have told it to type in the code? Just wondering if this is possible, and if so, how.

Typing
Does anyone have a code that would actually type something in from a text box, for example, with trojans when you use the keyboard. (not that I have used a trojan before o.O)

Upside Down Typing
Hello. I have a very strange question: Is there any way that you can use a RichTextBox and when the user types, it shows the text vertically. Any Ideas?

Typing In DirectX?
Hi. I've got my keyboard input sorted, but I'm having big problems with an otherwise extraordinarily simple subject... typing. Is there no way to enter typing other than to use tons of If statements looking for key presses? Surely I've overlooked some super-simple method out there somewhere?

If it matters, I'm trying to make it so users can type a profile name in for my game. And, as can be guessed, it ain't workin'.

Thanks in advance
SoM

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