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.
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Moving Within The Tree View
Hi all,
I have a tree view in my program. It gets its data from the database & displays it in the frames & textboxes present by its side.
Now I want that If a user moves a child node (drag & drop)from one parent to another, then the same is updated in the database as well.
This is how the structure of the tree view goes:
----Mine 1
--------Pit 1
------------Zone 1
----------------Blast1
----------------Blast2
----------------Blast3
------------Zone 2
----------------Blast1
----------------Blast2
----------------Blast3
--------Pit 2
------------Zone 1
----------------Blast1
----------------Blast2
----------------Blast3
------------Zone 2
----------------Blast1
----------------Blast2
----------------Blast3
Now I want that Blast 2 from Pit 2 > Zone 2 is moved from its original position to Pit 1 > Zone 1 then it must be updated in the database as well.
Can I attain this. Thanks all
Moving Columns On A Listview (Report View)
I want to programmatically set the Position of the columns in a list view.
This is an "after thought" so I am trying to do it on already loaded listviews.
I see from a little experimentation that I can easily move the column headers by simply changing the .position property.
But that does not bring over the data for that column. (Just the header)
Do I have to manually move the data or there an easier way?
(By "manually move the data" I mean set up a temp array, copy the column's data, update new column after moving other column into original col number)
Regards,
Excel 2000/VBA Moving Window To View Particular Cells
Hey all,
I'm having trouble trying to explain my problem, I hope this makes sense!
I have a menu at the top of a sheet with the headings to all of the tables below it (lots of them) and so I would like to create an active 'table of contents', whereby I can click on one of the headings which will scroll down to the relevant table. I have tried hyperlinks, but they only highlight the cell and make it visible, so it could appear at the bottom of the window or already be in the middle, etc... this is very messy, since other people will be using this system.
Also, the first 18 rows are frozen and need to remain that way. So the
selected heading/start of a table jumps to where the 19th row would be.
So my next idea is to create a button with some code behind it which will relocate the visible cells so that the heading for the table appears where A19 would be.
Rephrasing: Looking at a new sheet, you see cells A1 to S48. The rows 1-4 are frozen. I want to be able to use code to relocate the window view, so you see the frozen cells A1 to S4 and under row 4, cells A26 to S69. A26 being the key cell with the 'heading' in it and the table contents below it.
I have tried asking expert friends, googling, msdn-ing and haven't been able to find anything which sounds like what I want to do. I am not even 100% sure what I should be looking for.
Any help would be greatly appreciated!
Cheers,
Matt
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?
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?
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?
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 > -1) And (Item < 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 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?
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
List View Help (Not ListBOX)
i need to be able to copy the contents of listview1 to listview2 i cant work it out if u could show me some code that would help me out i would apreciate it
Thanx in advance
How To View A XLS Document In A ListBox?
I have a list box, which is called List1. Then when I click on a Picture box, which is called Picture1, it will then be able to make a row of information be placed in the last vacant position of the list box.
Tree View With Listbox
Is there any control wherin I can get the tree view connected with a list/combo box.Say for example in properties window in VB you replace the left hand side with a tree control .On clicking the nodes of the tree view the right hand side of the properties window change correspondinly
Thank you in anticipation.
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
List View To ListBox Thingy
Hey guys I have a listview called lvwfound and I was wondering, how do I click on a item that added to the list view to a list box thing.
The code that adds thigns to the list view is
VB Code:
Dim i As IntegerDim item As StringDim iResponce As Integeri = Me.lvwFound.ListItems.Count 'list countFor i = 0 To i - 1 'MsgBox Me.lvwFound.ListItems(i + 1) item = Me.lvwFound.ListItems(i + 1) '
Would i replace lvwfound with list4 ? Also i there a click event for a listview so only when I click on items in a listview it will add that item to a listbox?
Thank you.
ListBox, Bump New Item Into View ?
I have a ListBox that holds 5 lines of data. In my program, I add a line to the ListBox as certain events occur.
When I go to add the 6th item to the ListBox, a scrollbar appears, but the 6th item doesn't show up at the bottom.
For example, I want the ListBox to look like this when the 6th item is added:
Item #2
Item #3
Item #4
Item #5
Item #6
Thanks for any help...
View Search Results In A Listbox
Hi!
I would appreciate some help here...
I have a form where the user choose what he/she want to search the database for e.g. Name or Arrivaldate.
When the user has choosen what to search for he/she types in at text box what the search word is.
When the user click on the Search button the matching posts should be presented in the listbox.
This is my code so far:
VB Code:
Option Explicit Dim db As DatabaseDim rs As RecordsetDim max As LongDim i As LongDim ws As WorkspaceDim errormsgDim strSearchResults As String Private Function lstSearchName() If rs.RecordCount = 0 Then errormsg = MsgBox("No posts where found.", , "Error")End If rs.MoveLastrs.MoveFirst max = rs.RecordCount rs.MoveFirst lstSupportSearch.Clear For i = 1 To max lstSupportSearch.AddItem rs("Name") rs.MoveNextNext i lstSupportSearch.Visible = True End Function Private Sub cmdAdvancedSearch_Click() Dim strSearchString As StringDim datSearchString As DateDim boolArrival As BooleanDim boolName As BooleanDim boolSection As BooleanDim boolArrend As BooleanDim boolDeadline As BooleanDim boolFinished As Boolean strSearchString = txtSearchStringboolArrival = optArrivalboolName = optNameboolSection = optSectionboolArrend = optArrendboolDeadline = optDeadlineboolFinished = optFinished If boolName Then strSearchString = txtSearchString dtSearchSupport.Recordset.FindFirst ("Name='" & strSearchString & "'")End If If dtSearchSupport.Recordset.NoMatch Then MsgBox "No posts where found."End If Call lstSearchName End Sub Private Sub Form_Load() Set ws = DBEngine.Workspaces(0)Set db = ws.OpenDatabase("data.mdb")Set rs = db.OpenRecordset("tblSupport", dbOpenTable) End Sub Private Sub Form_Unload(Cancel As Integer) frmNewSupport.Show End Sub
As for now, I can se ALL my posts in the listbox.
But I do not get a error message.
As an extra feature, it would be nice if the user could dblclick on one post in the listbox and get back to the main form with that post active...
Please help me...
Resolved (Using A LIST VIEW Instead)ListBox Help Please
Why cant this simple bit of code work in VB yet does work no probs in excel vba. All it does is populate a listbox with 5 columns but it bombs out with the error WRONG NUMBER OF ARGUMENTS OR INVALID PROPETY ASSIGNMENT.
VB Code:
Private Sub cmdCommit_Click() With List1.AddItem (txtDesc.Text) 'column 1.List(.ListCount - 1, 1) = cmbType.Text 'column 2.List(.ListCount - 1, 2) = TxtDate.Text 'column 3.List(.ListCount - 1, 3) = txtAmount.Text 'column 4.List(.ListCount - 1, 4) = cmbOther.Text 'column 5End With End Sub
please help cos I dont know whats wrong
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
Listbox Or Listview To View The Html Code
hi guys
I couldn't find a listbox to view the web which i could also allows me to put the html code on my own program. Here is what I really want to have...
And It is possible to make a two listbox on each side with the close bars that will allows me to hide the listbox to close it only once at a time??
Help would appreciate it. Thanks
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
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
Listbox &"View To All&" Problem
I am currently designing a chatroom program in which I have a server and a client using winsock. The server is up and works fine.. and the client connects fine, and users are able to talk to eachother.. My problem is.. when a new user joins the chat it doesnt add to the list box, the 1st person to join can view anyone who joins, but if someone joins after someone else has, they wont be able to see them in the listbox/chatroom. Ive heard that you need to send out the list to everyone.. or something.. i dunno. Any examples or help would be much appreciated
Visual Basic List View Control To View Network Computers
Hi,
I am working on simple network connect utility and ready with the functinality. But I am stuck at a very important aspect of the GUI where I need a List View Control that will view the computers from the available LAN domains. And will let us select a particular computer on expanding the domain List Item. If not a list view then a treeview rather.
Also will this control let me select a NETWORK COMPUTER ONLY but not shared folders on its individual drives. Only computers has to be selected. Not the nodes (folders) shared at them.
Thanks.
Vinitsankhe.
How To View Records In Recordset In Access Datasheet View Using VBA Code
Hi all,
My requirement is - when a user fills in some date in Text boxes, and clicks a button, I use that data to create an SQL select query, execute it and store it in a recordset object.
I am able to retrieve the records and show them in the Debug window as follows
' Open a Recordset object.
recordset.Open Source:=strSQLFind, _
' Display the records in the Debug window.
Do While Not .EOF
For Each fld In .Fields
Debug.Print fld.Value & ";";
Next
Debug.Print
.MoveNext
Loop
Instead of printing on the Debug window, I want to view the records of recordset object in datasheet view.(so that the users can modify the values of the selected records)
So, could anyone please suggest me a way to do so.
Windows File Explorer.. Icon View And List View.
I'm trying to duplicate a function of the explorer.. The folder contents view.
See example of what I mean...
http://www.ibarn.net/fun/files/thumblist.jpg
I can do everything I need using the filelistbox with the sole exception of changing the display style. I don't want a file list, I want a list-view or icon-view. (Preferably both, with the option to switch between them.)
So my question to you fine people is...... what API or component could I find this capacity in? I've looked at all of the components and didn't see anything that looked close, and a search on the subject yeilds hundreds of people trying to emulate the "filemanager" explorer style, but none trying to kick out a normal, boring icon view like this.
Any help would be greatly appreciated.
Thanks.
List View PopUp Prob (lvwIcon View) *Resolved*
Hi all,
I have a listview in large icon view (lvwIcon). I have a popup menu displaying some options when the user right clicks an item that is specific for that item.
My question is this -
I want a different popup menu to show when the user right-clicks on a blank area of the listview which would display general options.
In my testing, whenever a blank area is clicked, the selected item is the first item (if none had been selected) or the current selected item (if one had already been selected).
I currently use the selecteditem.text to determine what pop up menu is to be used.
I guess in theory the code might be something like ;
Code:
If lvwMain.SelectedItem = Nothing then
PopupMenu mnuGeneral
Else
PopupMenu mnuSpecific
End If
Any help would be greatly appreciated.
Cheers
Jack
How Do I Edit And View Records Selected Using Sql In A Form View
I am using a sql statement to gather records from a database table. I
want to view these records in text boxes on a form. I want to be able
to view, edit, add, and delete operations to these records.
how do i put the data selected by the sql statement in the text boxes? do i use a loop? how do i scroll through all the records that are retrieved? what is different than scrolling through all the records in the table?
the names of the text boxes are : txtTerminal, txtMemoryLoc, txtContents
the names of the records' data fields in the database table are : Terminal, MemoryLoc, Contents
The sql stmt i think i should use is : Select * FROM selectedTable WHERE txtTerminal = txtTerminalNumber
the variable 'txtTerminal' is the name of the text box to display information regarding the selected terminal in.
the variable 'txtterminalNumber' is the number of the terminal the sql stmt selects records for.
Thank You in advance,
I can be emailed at : cpp_dev@yahoo.com
Win98 Landscape View To Portrait View
Hi everyone!
I would need help in changing my form's screen layout from portrait to landscape since the monitor, will be place in a 90 degress, where my program will run. It will be difficult to access the application since the screen is standing on its side. I'm using win 98 and vb 6.
Help urgent
Matching List View To Tree View
Hi Everyone,
Quick Question. I have a list view and a Tree view that are sharing the same data. The Tree view control lists all the Task Names and the List view control has the task detail. (Start, End Date and resources.)
The only issue is that the Line widths do not match. The Tree View nodes have more white space between them then the list view. Is there a way that I can match the width of the tree view rows to the rows on the List view?
Thanks
BDS
Can I View Multi Forms-same Page View?
If I create three forms: form1, form2, form3
Then I like to have form1 show on the top left and half page down and half page across. Then form2 show to the right of form1 for other half page across and half way down (as form1 is half way down).
Now form3 will show taking up the bottom full half of the page (Not being split in half across the page as form1 and form2).
I know how to Load form then show form for form1 and I can hide form1 then show form2, yet I can't find how to show two or more forms like I've mention above.
If someone could show me to a good thread or something,
Thanks
Rick101
List View, Tree View Controls
I have had the same problem... I ended up righting my own controls so that it would run faster on the population of the control...
Sorry
Brooke
Moving Balls To Moving Images??
Please take a look at this as it is related to my question
Thread
is it possible for the create images to be an image type that is already drawn?
Form View - Design View
I have come across an anomaly.
I am using a combo box to change the record displayed in a group of text boxes in a form.
When I first open the form, the data is not updated as I change my selection in the combo box. Also, I notice at the bottom it is record 1 of 1 for the Record Selector.
However, when I click design view for that form and then back to form view, when I select a record in the combo box, everything now updates.
Anyone have any ideas on this.
View Imags From DB In Listing View
Hi
I want to display images stored in access database in vb6 form but need to list more data beside the photo like:
producer name || Site || Logo || Profile
----------------------------------------------------------
Mona || www.company.com|| photo|| XXXXX
I tried to fill imagelist in runtime and assign values to listview from but everytime the imagelist returns nothing.don't know if listview didn't support photos or use another control
Tree View + List View
Hai,
In my application, I have Tree view on left side and List view on the right side which is just like windows Explorer. I would like to get the same functionality like Explorer where you can move the seperator between Tree View and List View. That means I would like to make the List View wider or shorter as I wish.
Can any body help me?
Thanking you in anticipation
|