Sybase NNTP forums - End Of Life (EOL)

The NNTP forums from Sybase - forums.sybase.com - are now closed.

All new questions should be directed to the appropriate forum at the SAP Community Network (SCN).

Individual products have links to the respective forums on SCN, or you can go to SCN and search for your product in the search box (upper right corner) to find your specific developer center.

how to hide a menu item, having its name in string variable ?

2 posts in .NET Winform Last posting was on 2009-08-06 15:05:44.0Z
Ahmed A. Posted on 2009-07-16 09:59:26.0Z
Sender: 613d.4a5ef678.1804289383@sybase.com
From: Ahmed A.
Newsgroups: sybase.public.powerbuilder.net.winform
Subject: how to hide a menu item, having its name in string variable ?
X-Mailer: WebNews to Mail Gateway v1.1t
Message-ID: <4a5ef9fe.63ca.1681692777@sybase.com>
NNTP-Posting-Host: forums-3-dub.sybase.com
X-Original-NNTP-Posting-Host: forums-3-dub.sybase.com
Date: 16 Jul 2009 02:59:26 -0700
X-Trace: forums-3-dub.sybase.com 1247738366 10.22.241.188 (16 Jul 2009 02:59:26 -0700)
X-Original-Trace: 16 Jul 2009 02:59:26 -0700, forums-3-dub.sybase.com
Lines: 3
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:872
Article PK: 707605

Having a menu item name in string variable (vmenuname), how
to make that menu item invisible in script ?


Brad Wery [TeamSybase] Posted on 2009-08-06 15:05:44.0Z
From: "Brad Wery [TeamSybase]" <bradweryATgmail.com>
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
MIME-Version: 1.0
Newsgroups: sybase.public.powerbuilder.net.winform
Subject: Re: how to hide a menu item, having its name in string variable ?
References: <4a5ef9fe.63ca.1681692777@sybase.com>
In-Reply-To: <4a5ef9fe.63ca.1681692777@sybase.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: vip152.sybase.com
X-Original-NNTP-Posting-Host: vip152.sybase.com
Message-ID: <4a7af148$1@forums-3-dub.sybase.com>
Date: 6 Aug 2009 08:05:44 -0700
X-Trace: forums-3-dub.sybase.com 1249571144 10.22.241.152 (6 Aug 2009 08:05:44 -0700)
X-Original-Trace: 6 Aug 2009 08:05:44 -0700, vip152.sybase.com
Lines: 33
X-Authenticated-User: teamsybase
Path: forums-1-dub!forums-master!forums-3-dub.sybase.com!not-for-mail
Xref: forums-1-dub sybase.public.powerbuilder.net.winform:882
Article PK: 707616

You'll have to create a recursive function to "walk" the menu so you can
find your item. Each menu item has an Items collection.

boolean of_HideMenu(menu a_menu, string as_menuname)

Long ll_index, ll_count

ll_count = UpperBound(a_menu.Items)

FOR ll_index = 1 TO ll_count
IF a_menu.Items[ll_index].Name = as_menuname THEN
a_menu.Items[ll_index].Visible = FALSE
RETURN TRUE
ELSE
IF of_HideMenu(a_menu.Items[ll_index], as_menuname) THEN
RETURN TRUE
END IF
END IF
NEXT

RETURN FALSE


This is totally off the top of my head. I'm not sure if it will work.

Good Luck!

Brad

Ahmed A. wrote:
> Having a menu item name in string variable (vmenuname), how
> to make that menu item invisible in script ?