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




How To Stop First Colume Edit In A Listview


How do you stop first colume edit?




View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread
Stop Masked Edit Beeping?
What I am trying to do is show a range of values in a masked edit box, the first value and the spacer being static, and the second set changeable.

I'm doing this be setting the mask to "$0.00 - $##.##"

But what I would like to do is allow the user to just type 2.25 instead of having to type 02.25, while at the same time allowing them to enter 22.25

I'm trying to catch the error with the ValidationError event, and that is fine, and I can change it so that it adds a leading 0 and stays in format, but it still beeps.

Is there any way I can stop the beep?


Code:
Private Sub inputbox_ValidationError(InvalidText As String, StartPosition As Integer)
Dim linefix As String
Dim retainer As String

retainer = InvalidText

If Mid$(retainer, StartPosition + 1, 1) = "." Then
'start line out with what was correct
linefix = Left$(InvalidText, StartPosition - 1)
'transpose values (lead with 0)
linefix = linefix & "0" & Mid$(InvalidText, StartPosition, 1)
'Finish the line as it was
linefix = linefix & Right$(InvalidText, Len(InvalidText) - (StartPosition + 1))
inputbox.Text = linefix
inputbox.SelStart = InStr(1, inputbox.Text, "_", vbBinaryCompare) - 1
inputbox.SelLength = 0
End If

End Sub


Also ... does anyone know why the value of InvalidText changes after the first time you read it?

Any help guys? Thanks

Stop Listview Selection
I am trying to stop the first row in a listview being selected when the form is first loaded.
I have tried using the

Code:
Listview1.SelectedItem = Nothing

in the Form_Activate and this doesn't work.
There is no other control on the form to set the focus to.

Any ideas or workarounds?

Stop Listview Flickering?
Hi folks,

I am having trouble in preventing flickering while adding items to a listview.

Please help!

Stop Drag In Listview
I found this code


Code:

' REQUIRES THE MSGHOOK.DLL LIBRARY

Const WM_NOTIFY = &H4E
Const LVN_FIRST = -100&
Const LVN_BEGINDRAG = (LVN_FIRST - 9)

Private Declare Sub CopyMemory Lib "kernel32" Alias "RtlMoveMemory" (dest As _
Any, source As Any, ByVal bytes As Long)

Private Type NMHDR
hwndFrom As Long
idFrom As Long
code As Long
End Type

Dim WithEvents FormHook As MsgHook

Private Sub Form_Load()
' start subclassing the current form
Set FormHook = New MsgHook
FormHook.StartSubclass Me

' fill the ListView1 control with data
' ... (omitted) ...
End Sub

' this event fires when the form is sent a message

Private Sub FormHook_BeforeMessage(uMsg As Long, wParam As Long, lParam As Long, _
retValue As Long, Cancel As Boolean)

' the ListView might be notifying something to its parent form
If uMsg = WM_NOTIFY Then
' copy the MNHDR structure pointed
' to by lParam to a local UDT
Dim nmh As NMHDR
CopyMemory nmh, ByVal lParam, Len(nmh)

' check whether the notification is from the ListView1 control
' and whether it's the beginning of a drag operation
If nmh.hwndFrom = ListView1.hWnd And nmh.code = LVN_BEGINDRAG Then
' yes, cancel this operation
retValue = 1
Cancel = True
End If
End If
End Sub




but I can't get it to work (I have a lisview on my form).

It craps out at:

Dim WithEvents FormHook As MsgHook

Any ideas?

Stop Listview Loading
Hi everyone!

I'm filling a listview with a lot of data. If the user gets tired, he can press a button "Cancel" which should stop the listview loading.

To do that, in the loading loop I put a flag which is continously read at every cycle, for example:

Code:
While count<MaxCount And GoOn

'fill listview
'...
count +=1
End while

' Routine for cancelling
Private sub OnBtnCancel_click (...)
    GoOn=False
end sub
 

However, while the listview is filling up, I cannot press any button because the UI is freezed. So the Cancel button is unuseful.
Usage of Listview.BeginUpdate and Listview.EndUpdate() is useless.

The only way I found to make this work is to have the listview filled by another thread... but this is of course illegal because one should have the UI thread which created the listview to handle it, and not another thread.

Does someone have an idea?

Thank you

Stop Movement Of Listview Icon
hello friends,

I add items (as Icons) and set the view to Icons. When I select and move
one of the items within the listview control, it appears to drag outside the
boundaries of the listview control and the vscroll and hscroll bars appear.
The problem is I want the items to remain aligned, not randomly spread
around. Also, this is a problem because my list view control is about 2
inches square. Can I keep the icon within the white space of the control
and can I keep everything aligned?

How To Stop The Renew Index's For Listview ?
peace be with you

i make a small project used " listview "

i add a 3 items therefore the index's will be [ 1 - 2 - 3 ]

when i remove the index "2" the index's changes like this [ 1 - 2 ]

and number [2] is the index 3 before the removed

the question is :

how to set the index's not changes ??

thanks

Stop ListView Column Header
Hi Everyone,

I am using an example from VBnet about subclassing and responding to notifications from the ListView Header.

http://vbnet.mvps.org/index.html?cod...ifications.htm

The question I am trying to figure out is this. How can I get a column header to stop resizing once it has gotten to a location to a certain location. For example, stop column 1 from resizing any smaller when pt.X = 20. I would appreciate any help.

Thanks.

Stop ListView Selection When Not Wanted
Wow... that's a tough topic. It's easier to explain than what it means in the subject.

I have a TreeView-ListView interfase. The problem I'm having is when I right-click over the ListView, e.g., show it's corresponding popupmenu, and select an option which would not open any new menu or something. E.g., change some values to variables, or change the apearance of the app. What happens is that the mouse (I don't know how to explain it) "keeps" on selection status, and would select all the items you hover the mouse over after this. Of course, this would end if you click anywhere or sth. But I want to avoid this "autoselection status". Does anybody know how to do it??

ListView - Stop Icons Moving
Hi,
I'm using a listview control in the Icon mode, to display a control panel for my application. The only problem is that when a user clicks an icon, when you move the mouse it moves the icon as well.

Is there any way to stop the user moving the icon?

Stop And Start A Service From A ListView
Hi

I want to be able to stop and start a service that is selected from a ListView, I've tried searching but cant find anything, does anyone have any ideas?

Thanks



LIVERPOOL FOOTBALL CLUB - 5 times Champions of Europe!! 1977, 1978, 1981, 1984, 2005

FA Cup Winners - 2006

Edited by - johneast on 3/15/2006 6:31:40 AM

Edit Listview
Is there a simple way to make a ListView editable (if you dbl click on an item in the list, it becomes editable)? I thought there was but I can't seem to get it. I only need the first column editable (it only has one column) Someone help pls....thanks.

Edit A Listview
I always use listviews (in lvwreport view mode) to display data but now I'd like to know/be reminded of whether the specific items and/or subitems can be manually edited for I have forgotten about it.

I have 2 columns, one of them is filled at mouse click with values of a function f(x,y) where (x,y) are the mouse coordinates on a picturebox. The values for other column I must enter manually.

If it's not possible I suppose I could use e.g. a msflexgrid.

Edit A Listview?
Is it possible to type to a listview? I've never tried and should know before I go too far ahead in my current project. If not maybe I should start with a FlexGrid.

Listview Tab Edit...
I found TheVader's Listview label edit cls.. its fantastic... but has anyone evr tried to do something liket his to allow tabbing through columns?

http://vbforums.com/showthread.php?t=300803


I want to add a new "record" then edit each field.. allowing tab to just to the next column....

Thanks!

Listview Edit?
I have 3 columns with 10 rows, two of the columns are filled with data already and the third one is blank. I would like to go back and add items to the third columns. how would i do this with listview?

Edit Listview
Is there any way to edit listview during runtime..
Plz don't tell me about moving Textbox to that cell ..

Edit A Listview
Can someone please help me with this ..
I have a listview will info in it - and i wanna edit the labals in it - (i tried in the propaty the autoedit and manual edit and it didnt edit it (with the mouse over it and with one click.)
Can someone please Help me with it (With code or adviZ)
Tnx

How To Edit Listview????
hi,

is there any expert know how to edit the subitem for the listview control? I only able to edit the itemselected field! PLs help! TQ in advance! And have a nice day!

ListView Edit
I know you can edit the first column of the listview control, is there a way
to edit the second and/or the other columns?

greets John

How To Edit In ListView?
I using listview, with two columns
I want the user will be able to change the text
in these two fields,but only the first field
is editable, can i change the second field

Stop Item Dragging/moving In ListView
Is there any way you can stop the user from moving the item position in a listview?? I need them to stay the same as i added them first by code, with them being fixed for the user and not allowing any movement of item position!

thanks!

Stop And Start A Service Selected From A ListView
Hi

I want to be able to stop and start a service that is selected from a ListView(using XP), I've tried searching but cant find anything, does anyone have any ideas?

Thanks


Listview Edit Subitem
How might I go about Editing Subitem in a Listview... Heres an idea I have about it

Working a basic example for learning purposes so I have made a simple LV and populated it with Data..
Main Subitem(1) Subitem(2)
Headers are LastName Firstname PhoneNumber


ok I want to select a row Click an cmdEdit it transfer the slected rows data to 3 TextBoxes while removing it from the Listview....allowing me to edit it then add it back sort of a crude edit...NOTE: I already have the code in place to add it back.... need code to remove item from Listview and populate the 3 textboxes....
FirstName LastName PhoneNumber
Text1(0).Text Text1(1).Text Text1(2).Text

Ofcourse, if I could edit the Subitems like I can the Main by smply clicking on it and typing in new data tha would be better I think

vbMarkO

How To Edit Listview Cells
Say my listview have 5 columns and I have to edit the cells on the 4th column, how do I go about it?

Edit Listview Subitems
Hi All,

in the attached picture is an example of the data that i displayed for the user to see in listview. how can i allow the subitems for editing by the users and save the edited datas.

i have searched through forum for similar examples to learn from. however, i am not able to find one. can anyone please help me in this area. thanks a million.

best regards.

Edit Subitem In Listview
i havin difficulties in dealin this
how do i code to make when i click on the subitem column i can change the record of the selected row

Set First Column In Listview To Non Edit
Hello,

Probably this is a stupid question, but I tried to look for an answer on many places already.

Is it possible with the listview in report mode, to have the first column non-editable? Because standard you are able to edit that column.

Many thanks,

Alain

KeyPress For ListView Edit
I Need to make it so that when somebody edits a value in my Listview that it only lets them enter in numbers. This is the code I use for a text box. How do I do the same thing with a ListView control?


Private Sub txtMPQty_KeyPress(ByVal KeyAscii As MSForms.ReturnInteger)
If KeyAscii < 45 Or KeyAscii > 57 Then KeyAscii = 0
End Sub

Edit Items In Listview
I have a form that has a listview control on it with 3 columns. These columns are being populated from 3 text boxes and a command button.
This part works fine.

But I would like to select an item entered into the listview and have the items and subitems populate the text boxes in the event I make a mistake on entering data. I have tried:

Code:
lvwhunt.selecteditem.key
to obtain the item key and populate the text boxes in the reverse order that I populated the listview.
Here is my code for populating the listview from the textboxes:

Code:
Private Sub cmdAddExt_Click()
On Error GoTo errhandler

dHNum = txtExtNum.Text
dHPair = txtPairNum.Text
sHName = txtExtName.Text

iHItems = iHItems + 1
lvwHunt.ListItems.Add iHItems, , dHNum
lvwHunt.ListItems(iHItems).SubItems(1) = dHPair
lvwHunt.ListItems(iHItems).SubItems(2) = sHName
lvwHunt.Refresh

dHNum = vbNull
dHPair = vbNull
sHName = vbNull
txtExtNum.Text = ""
txtPairNum.Text = ""
txtExtName.Text = ""
frmHunt.Repaint
txtExtNum.SetFocus

Exit Sub
errhandler:
Debug.Print Err.Number & " " & Err.Description
Err.Clear
Resume Next

End Sub

Hope this makes sense, thanks in advance for your assistence.

Bart

Edit Listview Events
hi,
i'm editing a listview by placing a text box over the wanted cell. it works great. BUT when my listview has a scrollbar and the user scrolls down, the text box stays where it was. my listview is an OCX control. any ideas on what events i could be trapping or how i can do this better?

Thx,
ROB

Edit All Fields Of A Listview?
Hello,
I am using a listview control and would like to allow all of it's items to be edited by the user. I have learned how to edit the items in the first column by using the LabelEdit property but that will not let me edit the other columns. Is there a way to edit the subitems of a listview by first selecting the row and then clicking again on the subitem?

Thanks.
Kevin

Listview Selection Edit
Hello,

I have read much information on editing the listview selected items. however
for some reason I'm drawing a blank with regard to editing the data I need.

For example, I have a listview assoctied with the columns of my access database, and the data shows as intended. However, once it loads and I select a row and then send the selected data to textboxes.

Here is were i get confused after sending the data to the textbox how do i update the selected field in the db and listview box. I know I need to do some kind of refresh or update, i hoping someone could give me a code example.

Edit ListView Item
Hi i've follow the FAQ "Database - How can I fill a ListView with values in a database?" and create a listview fill with item from my database. Now What can i do so that when i double click on one of the item in the listview it would bring up all the detail of that item so i can edit it.

Currently i ahve two form one is main with the listview and the other is edit form with all the field to be fill up by item in listview

I'm Currently using vb6.0 and access 2003

ListView Edit/update
I have a ListView control that gets it's values from a DB. How can I ensure that am able to edit and update the rows directly from the listview control?

How To Edit Subitems In Listview Vb6?
Is there a way to edit a subitem in listview? I've been searching the forums regarding this but found none. I tried using label edit but i figured that only the 1st column can be edited. It would be nice if a subitem can be edited.

Any suggestions is highly appreciated.

thanks

Listview Subitem Edit
hi,
I have listview with report style.It is posible to edit the subitems of the listview?

Popskie

Listview And Label Edit
I am using a listview (report style) and i am using its label edit functionality to add records to a database... so when the user clicks add new, it creates a new listitem and starts the label edit... now if the user clicks off the item, the listitem has a blank string which is no good.. but when the user does this, the afterlabeledit does't fire, so there is no way to immediatly validate what was entered. any way around this?

Edit Content In Listview
Hi!
I need to be able to edit every row under a column in a listview control. VB does this almost automatic with the labeledit property, but only with the listitem (the first column), not the listsubitems..

I could of course swap the order of my columns, but that would look very weird

Any suggestions?

Edit Sub Items In Listview?
Can you edit sub items in a list view using the same label edit method for the main listitem text?? i didn't think so.. but i wanted to confirm...

Can I Edit Columns In ListView Other Than The 1st
Following my first question, i would also like to know if I can Edit Columns in ListView Other than the 1st column.
The 1st Column contains the name, the others (let's suppose 12) his salary for the 12 months.

Thanks Guys

ListView Edit Problem
Hi!
I've a listview control that contains 3 columns.
I want to enable the user to edit all the column.
How can I do that?


(The next rows enable only the first column to edit.)

listview1.LabelEdit = lvwAutomatic
Private Sub listview1 _BeforeLabelEdit(Cancel As Integer)
Cancel = False
Thank you

Edit Label In ListView
I have a listViev and the user have not aloved to edit the label.
How ?

Edit Listview 2nd Column
i use a listview control in report view that has 3 columns i set its labeledit property to automatic so i can edit but now i can edit only the 1st column how can i edit the other 2?

How To Edit ListView SubItems In VB6
Hi,
I can edit ListView item but not the SubItems. Anyone got any sample code to edit ListView SubItems?
Thank you.
Rgds,
Gilroy.

Edit Data (Listview)
hi! i need help with my project... i want to edit my data using listview_click. when i click a selected record in listview ,it will open in another form. the problem is when i selected the record in listview it didn't load the selected record in another form.
kindly help...

here's my code:

Private Sub lstvw_Click()
Screen.ActiveForm.SearchRecord
End Sub


Public Sub SearchRecord()

If frmSearch.lstvw.ListItems.Count < 1 Then
   MsgBox "No data to edit, please add new record.", vbInformation, "Consolidation"
   Exit Sub
End If

strsql = "Select *From Query1 where Record = " & Val(frmSearch.lstvw.SelectedItem) & ""

Set rs = New Recordset
    rs.Open strsql, ConnectString(), adOpenForwardOnly, adLockReadOnly, adCmdText
   
    
With rs

frmAdd.txtRecord = !Record
frmAdd.DTPicker1.Value = !dtdate

frmAdd.txtFname = !stfname
frmAdd.txtMName = !stMid
frmAdd.txtLName = !Stlname
frmAdd.txtAddress = !stAddress
frmAdd.txtZip = !stZip
frmAdd.txtCity = !stCity
If rs.Fields("sthomePHone") <> "" Then
   frmAdd.txtHomePhone = !stHomePHone
end if

Call Load(frmAdd)
Call frmAdd.Show
Screen.ActiveForm.Fields_Enable (True) ' call to disable fields
Screen.ActiveForm.Button_disable
frmSearch.Hide
End With
  
   


   
   





End Sub




Edited by - edd_hills on 2/28/2005 7:09:26 AM

Multi-edit ListView
Hi all,

I think you've seen this question a thousand times... but stay with me...

I have a ListView (in report mode), and I want to be able to enhance it with two things:
a) I want to be able to select sub items.
b) I want to be able to edit sub items.

Heres the thing:
a) I want to be able to navigate the sub-items using the keyboard. i.e. pressing left and right arrows must select the next sub item... not scroll the list box. So basically this is the big one I can't get right (and didn't find the solution here, nor vbaccelerator, nor project source code).

b) I think I have solved this one I simply place a text box over the subitem and edit the text using it. So that is pretty much solved.

I was using a MS Flex Grid... It worked great for these two things... but I found the issue with it was that I couldn't change the columns widths.

Thanks guys.

Deny Edit In Listview
Hi,
i've got a listview in which i display data. Now when i click on an row it openes the first columnitem for edit. How can I avoid that? How can i make the items in my listview uneditable?

thanks in advance

Akademos

Deny Edit In Listview
Hi,
i've got a listview in which i display data. Now when i click on an row it openes the first columnitem for edit. How can I avoid that? How can i make the items in my listview uneditable?

thanks in advance

Akademos

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