Basic4ppc - Windows Mobile Development  

Go Back   Basic4ppc - Windows Mobile Development > Main Category > Questions & Help Needed
Home Register FAQ Members List Search Today's Posts Mark Forums Read

Questions & Help Needed Post any question regarding Basic4ppc.


Context Menu and Tree View.


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2008, 09:42 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default Context Menu and Tree View.

Is it possible to add a context menu to a tree view?

My tree view control is on a panel, on the desktop I can add the context menu to the panel and it works OK.
But on the device the tree view blocks the context menu (as documented in the help file).
Adding the context menu to the tree view gives the error message shown in the attachment....

If this is not possible at this time, will it be added in the future?

Thanks,
RandomCoder
Attached Images
File Type: png Error Msg.png (5.9 KB, 13 views)
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #2 (permalink)  
Old 02-18-2008, 03:13 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

You should use the ControlRef property to pass a library control to a library method.
Try:

FrmLibMain.Add(TreeViewInbox.ControlRef,...)
Reply With Quote
  #3 (permalink)  
Old 02-18-2008, 03:56 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Default

Quote:
Originally Posted by Erel View Post
You should use the ControlRef property to pass a library control to a library method.
Try:

FrmLibMain.Add(TreeViewInbox.ControlRef,...)
I'm not sure that I completely understand as I'm still unable to make this work.
Using Msgbox( TreeViewInbox.ControlRef ) returns nothing after the treeview has been created

Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
  #4 (permalink)  
Old 02-18-2008, 05:06 PM
Erel's Avatar
Administrator
 
Join Date: Apr 2007
Posts: 3,199
Default

Msgbox(Tree.ControlRef) doesn't display anything as ControlRef is not a string but rather a reference to the control.
Did you try:
FrmLibMain.AddContextMenu(TreeViewInbox.ControlRef ,...)

It should work properly.
Reply With Quote
  #5 (permalink)  
Old 02-18-2008, 05:35 PM
RandomCoder's Avatar
Basic4ppc Veteran
 
Join Date: May 2007
Location: UK
Posts: 486
Awards Showcase
Beta Tester 
Total Awards: 1
Thumbs up It's working

Fantastic!
Thanks Erel, it works perfectly.

My mistake was that in your first post you said to try FrmLibMain.Add(TreeViewInbox.ControlRef,...)
when infact I actually needed FrmLibMain.AddContextMenu(TreeViewInbox.ControlRef ,...) as pointed out in your last post.

Kind Regards,
RandomCoder
__________________
Desktop: Pentium D 920 (2.8GHz, 4MB L2 Cache, 800MHz FSB), 1024MB, 256MB Radeon X600, 250GB HD.
Device : Axim X51v XScale 624MHz, 3.7" VGA, 64MB SDRAM, 256MB Flash ROM + 1Gb SD.

"Defeat never comes to any man until he admits it."Josephus Daniels
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Tree View - Help Cableguy Questions & Help Needed 18 07-19-2008 01:43 PM
Need for context menu francisco cobos Questions & Help Needed 6 03-05-2008 03:33 PM
Another problem with tree view RandomCoder Questions & Help Needed 8 02-28-2008 12:36 PM
Registry to Tree View willisgt Questions & Help Needed 0 02-20-2008 05:17 PM
Tree View Images RandomCoder Questions & Help Needed 8 02-08-2008 05:16 PM


All times are GMT. The time now is 03:30 AM.


Powered by vBulletin® Version 3.6.12
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0