Thread View: comp.lang.basic.visual.misc
4 messages
4 total messages
Started by Lukas Casar
Tue, 16 Sep 1997 00:00
Control creation
Author: Lukas Casar
Date: Tue, 16 Sep 1997 00:00
Date: Tue, 16 Sep 1997 00:00
28 lines
2204 bytes
2204 bytes
Hello everyone, I've got serious problems in control creation...
1) How to write to runtime-read-only properties of control I'm using as
the base of my new control.
I need to create my own control based on standard ListView. ListView
has for example 'HideSelection' property, which is read-only in runtime.
But when I'm creating own control based on ListView, this ListView is in
'runtime' mode while my new control is in design-time in VB development
environment. It means that I can't change this property of ListView in
design-time of my new control, because that ListView in already in
runtime mode. How to solve this ?
2) Problem with PropBag (Property Bag). I need to define own properties
for each column in original ListView (BO property bounding and other new
features). In fact this requires to store a collection or an array to
the PropBag. But when I tried to use collection, it displayed 'System
error - Such interface not supported' message after WriteProperties. So
I tried to use an array, but I wasn't able to read it then by
ReadProperties, because it isn't possible to write something like
MyArray=PropBag.ReadProperties("MyArray") - you can't assign a array by
"=".
Thanks for any advice
Lukas Casar
PS: Please reply to casar@integia.cz, I don't read news often...
Re: Control creation
Author: Bob Butler
Date: Tue, 16 Sep 1997 00:00
Date: Tue, 16 Sep 1997 00:00
56 lines
3356 bytes
3356 bytes
Lukas Casar <casar@integia.cz> wrote in article
<341E897E.3749@integia.cz>...
> Hello everyone, I've got serious problems in control creation...
>
> 1) How to write to runtime-read-only properties of control I'm using as
> the base of my new control.
> I need to create my own control based on standard ListView. ListView
> has for example 'HideSelection' property, which is read-only in runtime.
> But when I'm creating own control based on ListView, this ListView is in
> 'runtime' mode while my new control is in design-time in VB development
> environment. It means that I can't change this property of ListView in
> design-time of my new control, because that ListView in already in
> runtime mode. How to solve this ?
Unless you want to build your own version from scratch, the simplest way to
implement this would be to place two ListView controls on your user control
and set the HideSelection property True on one, False on the other. Put
your own HideSelection property on your usercontrol and toggle visibility
on the ListViews so that the desired one shows whenever the HideSelection
property changes. You must remember to update all other properties on the
two controls in synch. It's crude, but effective.
>
> 2) Problem with PropBag (Property Bag). I need to define own properties
> for each column in original ListView (BO property bounding and other new
> features). In fact this requires to store a collection or an array to
> the PropBag. But when I tried to use collection, it displayed 'System
> error - Such interface not supported' message after WriteProperties. So
> I tried to use an array, but I wasn't able to read it then by
> ReadProperties, because it isn't possible to write something like
> MyArray=PropBag.ReadProperties("MyArray") - you can't assign a array by
> "=".
You need to convert your array to a series of individual properties in the
read/write routines:
For x=lbound(myarray) to ubound(myarray)
myarray(x)=propbag.readproperties("myarray" & cstr(x))
Next x
You store it in an array, but record it as 'myarray1', 'myarray2', etc
>
> Thanks for any advice
> Lukas Casar
>
>
> PS: Please reply to casar@integia.cz, I don't read news often...
>
--
Please reply through the newsgroup. The reply e-mail
address is garbage to reduce the spam rate.
Re: Control creation
Author: Bart Lateur
Date: Tue, 16 Sep 1997 00:00
Date: Tue, 16 Sep 1997 00:00
29 lines
2041 bytes
2041 bytes
Lukas Casar <casar@integia.cz> wrote: >1) How to write to runtime-read-only properties of control I'm using as >the base of my new control. > I need to create my own control based on standard ListView. ListView >has for example 'HideSelection' property, which is read-only in runtime. >But when I'm creating own control based on ListView, this ListView is in >'runtime' mode while my new control is in design-time in VB development >environment. It means that I can't change this property of ListView in >design-time of my new control, because that ListView in already in >runtime mode. Properties like this (e.g. the sorted property of a list box, or the style of a combo box) aren't really properties. VB simply creates a different type of control, depending on the value you assign to these properties. That's why these properties are read-only. What is worth checking out, although I haven't actually used it yet, is the very decent freeware DLL's from SoftCircuits, like VB-asm (16-bit) and VBHelper (32-bits). These let you recreate a VB control at run time. This should allow you to do what you want. http://www.softcircuits.com/sw_tools.htm HTH, Bart.
Re: Control creation
Author: Ryan Faricy
Date: Wed, 17 Sep 1997 00:00
Date: Wed, 17 Sep 1997 00:00
58 lines
3239 bytes
3239 bytes
For your first question, you can use SetWindowLong for this.
For your second, try looping through the array and saving each array as
Array1=..., Array2=...
When you want to retrieve the properties, loop and parse the properties and
use the method to add whatever it is that you need.
--
R�an � Fearthachse (Ryan Faricy) - jtons@minn.net
� Eire! (from Ireland!)
CEO - RySoft Corporation
RySoft VB Expedition, version 2.0!
http://www1.minn.net/~jtons/
Microsoft SiteBuilder Network Level 2
Mo �hdar (my quote): "The unparalleled evacuation of rampant paradigm
shifts
will destabilize tomorrow's egalitarianism"
Lukas Casar wrote in article <341E897E.3749@integia.cz>...
>Hello everyone, I've got serious problems in control creation...
>
>1) How to write to runtime-read-only properties of control I'm using as
>the base of my new control.
> I need to create my own control based on standard ListView. ListView
>has for example 'HideSelection' property, which is read-only in runtime.
>But when I'm creating own control based on ListView, this ListView is in
>'runtime' mode while my new control is in design-time in VB development
>environment. It means that I can't change this property of ListView in
>design-time of my new control, because that ListView in already in
>runtime mode. How to solve this ?
>
>2) Problem with PropBag (Property Bag). I need to define own properties
>for each column in original ListView (BO property bounding and other new
>features). In fact this requires to store a collection or an array to
>the PropBag. But when I tried to use collection, it displayed 'System
>error - Such interface not supported' message after WriteProperties. So
>I tried to use an array, but I wasn't able to read it then by
>ReadProperties, because it isn't possible to write something like
>MyArray=PropBag.ReadProperties("MyArray") - you can't assign a array by
>"=".
>
>Thanks for any advice
> Lukas Casar
>
>
>PS: Please reply to casar@integia.cz, I don't read news often...
begin 666 Reahan T. Fearthachse.vcf
M0D5'24XZ5D-!4D0-"DXZ1F5A<G1H86-H<V4[4F5A:&%N.U0N#0I&3CI296%H
M86X@5"X@1F5A<G1H86-H<V4-"D5-04E,.U!2148[24Y415).150Z:G1O;G-
5;6EN;BYN970-"D5.1#I60T%21 T*
`
end
end
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads