Groups | Blog | Home
all groups > asp.net > february 2004 >

asp.net : CheckedListBox in asp.net


Erik Cruz
2/25/2004 10:58:08 PM
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

Alvin Bruney [MVP]
2/26/2004 10:18:29 AM
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
[quoted text, click to view]

Erik Cruz
2/28/2004 7:20:09 PM
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

[quoted text, click to view]

AddThis Social Bookmark Button