CheckedListBox in asp.net

E

Erik Cruz

Hi.

I have read some articles about hosting windows forms controls on asp.net
pages but all of them show how to use custom controls. I would like to show
on one of my pages the checkedlistbox windows control. I believe that the
steps are the same, but what do I need to reference in my <object> tag in
order to acomplish this?

TIA,
Erik Cruz
 
A

Alvin Bruney [MVP]

you don't need to mess with the object tag because you may have a type
entering the clsid. Just drag the windows control unto the form. Studio (if
that's what you are using) will automatically fill in the blanks. I am
assuming you have the rest setup correctly
here's what the code should look like for a slider web control added on to a
form. the object tag is below
[ComSourceInterfaces (typeof(IWebSliderEvents))]

public class WebSlider : System.Windows.Forms.TrackBar{}

[InterfaceType (ComInterfaceType.InterfaceIsIDispatch)]

public interface IWebSliderEvents

{

//[DispId (1)] void SizeChanged (object sender, EventArgs e);

[DispId (1)] void Scroll(object sender, EventArgs e);

}

//object
<OBJECT id="Slider" style="Z-INDEX: 101; LEFT: 160px; WIDTH: 160px;
BORDER-TOP-STYLE: outset; BORDER-RIGHT-STYLE: outset; BORDER-LEFT-STYLE:
outset; POSITION: absolute; TOP: 152px; HEIGHT: 16px; BORDER-BOTTOM-STYLE:
outset"
classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" VIEWASTEXT>

</OBJECT>
 
E

Erik Cruz

Hi Alvin.

I created the control and added it to my toolbox. However, the control
appears grayed out in my toolbox and I can't drag it to my web form. Is it
the default behaviour? How can I turn it available in my toolbox?

TIA,
Erik Cruz

Alvin Bruney said:
you don't need to mess with the object tag because you may have a type
entering the clsid. Just drag the windows control unto the form. Studio (if
that's what you are using) will automatically fill in the blanks. I am
assuming you have the rest setup correctly
here's what the code should look like for a slider web control added on to a
form. the object tag is below
[ComSourceInterfaces (typeof(IWebSliderEvents))]

public class WebSlider : System.Windows.Forms.TrackBar{}

[InterfaceType (ComInterfaceType.InterfaceIsIDispatch)]

public interface IWebSliderEvents

{

//[DispId (1)] void SizeChanged (object sender, EventArgs e);

[DispId (1)] void Scroll(object sender, EventArgs e);

}

//object
<OBJECT id="Slider" style="Z-INDEX: 101; LEFT: 160px; WIDTH: 160px;
BORDER-TOP-STYLE: outset; BORDER-RIGHT-STYLE: outset; BORDER-LEFT-STYLE:
outset; POSITION: absolute; TOP: 152px; HEIGHT: 16px; BORDER-BOTTOM-STYLE:
outset"
classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" VIEWASTEXT>

</OBJECT>
--
Regards,
Alvin Bruney [ASP.NET MVP]
Got tidbits? Get it here...
http://tinyurl.com/3he3b
Erik Cruz said:
Hi.

I have read some articles about hosting windows forms controls on asp.net
pages but all of them show how to use custom controls. I would like to show
on one of my pages the checkedlistbox windows control. I believe that the
steps are the same, but what do I need to reference in my <object> tag in
order to acomplish this?

TIA,
Erik Cruz
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,898
Latest member
BlairH7607

Latest Threads

Top