Click here to Skip to main content
15,885,537 members
Articles / Programming Languages / Javascript

VisualJS.NET custom control development

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
14 Nov 2012CPOL4 min read 16.5K   198   13  
How to use custom JavaScript controls under VisualJS.NET.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing; 
using VisualJS;
using VisualJS.Web.Forms;
using System.Linq;
using System.Text;

namespace SpinnerTest.VisualJSApp
{
    public partial class SpinnerForm : VisualJS.Web.Forms.Form
    {

#region Constructors
        public SpinnerForm()
        {
            InitializeComponent();
            AfterInitialization();
        } 

        //Use the below constructor if you create the instance of this Form object other than the active Thread
        //otherwise you will receive "Cant locate the ClientID in active context. Consider using Form constructor with ClientID parameter" exception
        public SpinnerForm(string clientId): base(clientId)
        {
            InitializeComponent(); 
            AfterInitialization();
        }
#endregion

        //Use below method for the tasks after the initialization of the Form
        void  AfterInitialization()
        {

        }

        private void btnStep_Click(object sender, EventArgs e)
        {
            this.spinner1.Step = 5;
        }

        private void button5_Click(object sender, EventArgs e)
        {

        }

        private void button6_Click(object sender, EventArgs e)
        {
            this.spinner1.Min = 0;
        }

        private void btnOnOff_Click(object sender, EventArgs e)
        {
            this.spinner1.Enabled = !this.spinner1.Enabled;
        }

        private void btnMin_Click(object sender, EventArgs e)
        {
            this.spinner1.Min = 0;
        }

        private void btnClearMin_Click(object sender, EventArgs e)
        {
            this.spinner1.Min = null;
        }

        private void btnPage_Click(object sender, EventArgs e)
        {
            this.spinner1.Page = 3;
        }

        private void btnPageDown_Click(object sender, EventArgs e)
        {
            this.spinner1.PageDown();
        }

        private void btnPageUp_Click(object sender, EventArgs e)
        {
            this.spinner1.PageUp();
        }

        private void spinner1_TextChanged(object sender, EventArgs e)
        {
            lblResult.Text = spinner1.Value.ToString();
        }
    }
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Poland Poland
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions