Send a suggestion!

We're building a brand new version of the site, and we'd love to hear your ideas

Members

Technology Zones

IBM Learning Center

Articles

Hosted By

MaximumASP

Info

Rated
Read 33,174 times

Contents

Related Categories

.NET Applets - To The Code!

qwert231

To The Code!

If you've done a windows form control, or even just a windows form (controls aren't much harder than forms themselves, just a different mindset) you can do this .NET Applet stuff.

The Control

Create a new Windows Control Library project (demoControl). Drop your items and code into it and compile. Okay, okay, an example… let's do this (thanks Sven):

We have our project. It should default with a User Control. This looks like a Windows Form grid, but without the title bar. Quick reason behind this, it's NOT A FORM. It's a control. Your form will have the title bar, and any menus. (You also cannot drag a Main Menu component to this grid.)

So, drag some controls to your User Control (myControl). In our demo we are going to use a Combo Box and a Label. Very simple. Fill your Combo Box with some items. Whatever you feel like. I'm using different types of computer systems. (Laptops, Tablet PCs, Desktops)

Now we need to create some code. Double click on your combo box. The designer will create a method to handle the SelectedIndexChanged event. For example purposes, simply put some code in that takes the combo box text and drops it into the Label.Text property.

VB.NET

Me.Label10.Text = Me.ComboBox1.SelectedText

We're done for now, compile it and on to the HTML.

Comments

  • Re: [4683] .NET Applets

    Posted by AlbertoG on 01 Feb 2007

    Wath about the interaction of the hosted control with the Javascript? 

    i saw that developing the control in .net 1.1 framework is it possible... but using 2.0 i got some truble...

    ...

  • Nicely done!

    Posted by DMarko1 on 02 Apr 2005

    Very nice and concise. Good work M!