Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Suite Pro
  New Posts New Posts RSS Feed - Taskpanel Remove item
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Taskpanel Remove item

 Post Reply Post Reply
Author
Message
Woody View Drop Down
Newbie
Newbie


Joined: 07 July 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Woody Quote  Post ReplyReply Direct Link To This Post Topic: Taskpanel Remove item
    Posted: 12 October 2004 at 3:21pm
Does anyone have a working example of how to remove a TaskPanelGroupItem using the Remove method? I'm having to use Group.Items.Clear, and then add them again, but this is causing problems and I can't find any documentation.
Back to Top
gshawn View Drop Down
Senior Member
Senior Member


Joined: 04 October 2004
Status: Offline
Points: 227
Post Options Post Options   Thanks (0) Thanks(0)   Quote gshawn Quote  Post ReplyReply Direct Link To This Post Posted: 12 October 2004 at 3:31pm

Hi,

I may not be the best person to answer since I've only used the Suite for a couple of hours, but this is one way to remove an item:

wndTaskPanel.Groups(1).Items(1).Remove

That will remove the first item from the first panel. I hope this helps at least a little.

Back to Top
Woody View Drop Down
Newbie
Newbie


Joined: 07 July 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Woody Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 5:27am
Thanks for trying, but that didn't work either.

I thought Remove should work like this:

Const ID_TASK_FIND_COMPANY_GROUP1 = 640

Set Group = wndTaskPanel.Groups.Add(ID_TASK_FIND_COMPANY_GROUP1, "Company Search")

Set Item = Group.Items.Add(ID_TASK_FIND_COMPANY_ITEM1, "", xtpTaskItemTypeControl)

Then:
      Set Group = wndTaskPanel.Groups.Find(640)
      Set Item = Group.Items.Remove(1)

What am I doing wrong?

Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 5:44am

Hi Woody

You can remove an item using Group.Items.Remove(1) however as it doesn't then return an TaskItem, your code will fail when you try to Set Item =  Group.Items.Remove(1)

The following code should work if you place it in a form with a taskpanel (wndTaskPanel) and a command button (command1). It will also allow you to specify your ID for the taskitem rather than having to know the Index position...

Const ID_TASK_FIND_COMPANY_GROUP1 As Long = 640
Const ID_TASK_FIND_COMPANY_ITEM1 As Long = 641
Private group As XtremeSuiteControls.TaskPanelGroup
Private item As XtremeSuiteControls.TaskPanelItem
Private Sub Command1_Click()
  Set group = wndTaskPanel.Groups.Find(ID_TASK_FIND_COMPANY_GROUP1)
  Debug.Print group.Items.Count
  Set item = group.Items.Find(ID_TASK_FIND_COMPANY_ITEM1)
  item.Remove
  Debug.Print group.Items.Count
End Sub
Private Sub Form_Load()
  Set group = wndTaskPanel.Groups.Add(ID_TASK_FIND_COMPANY_GROUP1, "Company Search")
  Set item = group.Items.Add(ID_TASK_FIND_COMPANY_ITEM1, "", xtpTaskItemTypeControl)
End Sub



Edited by ianp
Back to Top
Woody View Drop Down
Newbie
Newbie


Joined: 07 July 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Woody Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 6:43am
I tried this out and I still get error 'Object doesn't support this property or method'
Using version 9.1, could this be a bug?

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 7:15am
Ianp's code does work.

Try changing to this code, it will let you see the item that is being removed:
Set item = group.Items.Add(ID_TASK_FIND_COMPANY_ITEM1, "Some Text", xtpTaskItemTypeText)

This is assuming that you want to remove an item within a group and not an entire group.
Back to Top
Woody View Drop Down
Newbie
Newbie


Joined: 07 July 2004
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Woody Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 8:07am
Shouldn't Private item As XtremeSuiteControls.TaskPanelItem be Private item As XtremeSuiteControls.TaskPanelGroupItem ?

first one isn't recognised, and this may be the problem.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 13 October 2004 at 9:31am
Yes you are right, I didn't see that you said you were using 9.1.  TaskPanelItem is an Interface added in 9.5.  I would recommend downloading the latest version if you can.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.