|
-
May 22nd, 2006, 03:58 PM
#1
Thread Starter
Fanatic Member
ListView LabelEdit
Hello,
I have a ListView that "after" a label edit I need to add spaces to the beginning of the file name. My problem is that any code ran in the AfterLabelEdit event actually takes place before the ListViews own LabelEdit logic updates the text of the ListViewItem.
So...
1) User edits label
2) I assign the text
3) AfterLabelEdit changes the text back after the exiting the event from my side.
The only thing I can think of at this point is to set a timer at the end of the AfterLabelEdit event to set the text to what I want it. Seems like a pretty lame solution to me.
Any suggestions?
Thanks in advance,
Christian
In life you can be sure of only two things... death and taxes. I'll take death.
-
May 22nd, 2006, 04:03 PM
#2
Re: ListView LabelEdit
What if you perform the label edit manually or Override the listview events?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 22nd, 2006, 04:08 PM
#3
Thread Starter
Fanatic Member
Re: ListView LabelEdit
Not sure what you mean by manually.
Haven't tried overriding the listview event. Don't I have to create my own inherited ListView object to do that? Or is there an easier way?
In life you can be sure of only two things... death and taxes. I'll take death.
-
May 22nd, 2006, 04:11 PM
#4
Re: ListView LabelEdit
Yes, you would have to inherit the listview.
Manually, I mean calling the .StartLabelEdit in code and not sure if it would be called modally, but if it is then you could call your update fix after on the next line of c0d.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 22nd, 2006, 04:33 PM
#5
Thread Starter
Fanatic Member
Re: ListView LabelEdit
Yea,
I do call it manually:
ListViewItem.BeginEdit()
Then I have an event handler:
ListView_AfterLabelEdit
Problem is the text is updated by the ListView after the exit of the ListView_AfterLabelEdit even handler. Not exactly intuitive.
The code execution does not pause after BeginEdit() so the next line thing wont work.
Thanks.
In life you can be sure of only two things... death and taxes. I'll take death.
-
May 22nd, 2006, 05:10 PM
#6
Re: ListView LabelEdit
Then I can only think of using a timer or inheriting the listview for an overrride.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
May 22nd, 2006, 05:16 PM
#7
Thread Starter
Fanatic Member
Re: ListView LabelEdit
Thanks for all your help RobDog.
In life you can be sure of only two things... death and taxes. I'll take death.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|