Re: How to disable listbox entry by Ook
Ook
Wed Sep 15 16:17:30 CDT 2004
The plot thickens. If your rowsourcetype is an array, it does not evaluate
backslashes like it does if your rowsourcetype is set to value.
\\\\MyPath displays properly if value, but displays as disabled '\\\MyPath'
if in an array. The listbox and combobox both handle these the same way, and
are not consistent for different rowsourcetypes. So - my question now
becomes, how do you get the following:
\\MyPath
To appear enabled or disabled, if your rowsource is an array? Without the
leading space?
"Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
news:ecMpCr1mEHA.3712@TK2MSFTNGP15.phx.gbl...
> Ook,
>
> After re-reading your post, I noticed you don't want the space, so when to
> the VFP8 help and the solutions is pretty simple:
>
> lcServerPath = ("\]\\\MyServer\\MyMachine\\MyFolder")
> this.RowSource = "Any Item,"+ lcServerPath + ",\Another Item"
>
> ** This is from the VFP8 Help file **
> If the expression begins with multiple backslashes, the item is not
> disabled. If you want to disable an item that begins with multiple
> backslashes, add a backslash and a close bracket (]) to the beginning of
the
> item. For example, the following would disable the UNC path item in the
list
> box:
> MyForm.List1.AddItem("\]\\\MyServer\\MyMachine\\MyFolder")
> --
> Edhy Rijo
> Programming System Solutions www.progytech.com
> Bronx NY
>
>
> "Edhy Rijo" <erijo@msn.com.NO_SPAM> wrote in message
> news:u4Eobn1mEHA.644@tk2msftngp13.phx.gbl...
> > Hi Ook,
> >
> > I tested this from the INIT() of a ListBox in VFP8
> >
> > lcServerPath = "\\\server\Application Share Folder"
> > this.RowSource = "Any Item,"+"\ "+lcServerPath + ",Another Item"
> >
> > --
> > Edhy
> >
> > "Ook" <usenet@nospam.emberts.com> wrote in message
> > news:uYBNdk0mEHA.3520@TK2MSFTNGP11.phx.gbl...
> >>I have the need to disable listbox entries that start with '\\', such as
a
> >> network path. Normally, you start the entry with '\', and it will be
> >> disabled. If you have a legitimate backslash, you would change it two
> >> backslashes so that it is enabled and displays a single backslash.
BUT -
> >> if
> >> you have two or more backslashes, it will just display backslashes and
> >> not
> >> disable the entry. How would you get \\SomePath to appear as disabled?
I
> >> can
> >> put a space between a backslash and the rest of the item, but then I
have
> >> a
> >> disabled entry with a leading space.
> >>
> >>
> >
> >
>
>