Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TreeView - Fire AfterLabelEdit Event

Posted on 2004-08-11
7
Medium Priority
?
509 Views
Last Modified: 2008-01-09
With VB6 and the TreeView control,

Is it possible to fire the AfterLabelEdit event even when the node label was not changed?

(While editing a label, if the user presses Enter without making any change to the label, or if simply clicks elsewhere, AfterLabelEdit is not fired.)
0
Comment
Question by:campinas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 22

Assisted Solution

by:DarkoLord
DarkoLord earned 400 total points
ID: 11771729
You could subclass a treeview to recieve all messages... if you don't want to do that we'll find a different solution...

Darko
0
 

Author Comment

by:campinas
ID: 11771843
Then I'd have to change a lot of code.. What would be the other solution?
0
 
LVL 19

Accepted Solution

by:
arif_eqbal earned 1600 total points
ID: 11772107
Well If a user starts Editing of a Label and without changing the original text comes out of editing mode then the AfterLabelEdit event is not fired. If this is your problem then you can use a bit of trick.

Declare a form level variable say EditStart
on BeforeLabelEdit event set it to True, i.e once the user starts editing we set this flag. Now in order to cancel this edit he will have to click somewhere, Now trap the LostFocus and Click event of TreeView and check if your Flag is True or not If it is then call your AfterlabelEdit event function.

In case you need a working code I can write it for you just post back here.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:campinas
ID: 11775834
Thank you !  It's clear for me... I'll probably have to add the  check for Enter too.
0
 
LVL 22

Expert Comment

by:DarkoLord
ID: 11775885
Hi again,
I tried that what arif_eqbal said even before posting my first message but I couldn't get keyboard event to fire, because when you press the key while editing, the key is actually not pressed in a treeview but in a textbox that you type into...

good luck!
Darko
0
 

Author Comment

by:campinas
ID: 11775963
Oops...
0
 

Author Comment

by:campinas
ID: 11776015
Then maybe forcing AfterLabelEdit is not really a practical idea...
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question