Click here to Skip to main content
15,888,968 members
Home / Discussions / C#
   

C#

 
AnswerRe: user defined color change in c# Pin
dan!sh 17-Nov-09 20:58
professional dan!sh 17-Nov-09 20:58 
QuestionNeed help with text editing preaty please Pin
Member 414586317-Nov-09 19:42
Member 414586317-Nov-09 19:42 
AnswerRe: Need help with text editing preaty please Pin
Mycroft Holmes17-Nov-09 20:32
professionalMycroft Holmes17-Nov-09 20:32 
AnswerRe: Need help with text editing preaty please Pin
_Maxxx_18-Nov-09 18:03
professional_Maxxx_18-Nov-09 18:03 
QuestionCustom Window Control Pin
Nisha Agrawal17-Nov-09 19:35
Nisha Agrawal17-Nov-09 19:35 
AnswerRe: Custom Window Control Pin
dan!sh 17-Nov-09 21:02
professional dan!sh 17-Nov-09 21:02 
AnswerRe: Custom Window Control Pin
The Man from U.N.C.L.E.17-Nov-09 21:10
The Man from U.N.C.L.E.17-Nov-09 21:10 
AnswerRe: Custom Window Control Pin
Shameel17-Nov-09 21:46
professionalShameel17-Nov-09 21:46 
Create a UserControl and add the constituent controls in it, for example, text box, month calendar, etc. Expose the properties, events and methods of the constituent controls by creating properties, events and methods for the UserControl and mapping them to the constituent controls. For example:

C#
class MyTextBox {
    TextBox textBox1 = new TextBox();
    EventHandler TextChanged;

    public MyTextBox() {
        textBox1.TextChanged += EventHandler(textBox1_TextChanged);
    }

    //Expose property
    public string Text {
        get { return textBox1.Text; }
        set { textBox1.Text = value; }
    }

    //Expose event
    private void textBox1_TextChanged(object sender, EventArgs e) {
        if (TextChanged != null)
            TextChanged();
    }

    //Expose method
    public void Clear() {
        textBox1.Clear();
    }
}


Custom controls can only be used to extend the functionality of an existing control. You cannot add additional controls to it.
AnswerRe: Custom Window Control Pin
Nisha Agrawal17-Nov-09 22:37
Nisha Agrawal17-Nov-09 22:37 
GeneralRe: Custom Window Control Pin
dan!sh 17-Nov-09 22:57
professional dan!sh 17-Nov-09 22:57 
GeneralRe: Custom Window Control Pin
Nisha Agrawal18-Nov-09 16:05
Nisha Agrawal18-Nov-09 16:05 
GeneralRe: Custom Window Control Pin
_Maxxx_18-Nov-09 18:09
professional_Maxxx_18-Nov-09 18:09 
GeneralRe: Custom Window Control Pin
Nisha Agrawal19-Nov-09 18:53
Nisha Agrawal19-Nov-09 18:53 
GeneralRe: Custom Window Control Pin
The Man from U.N.C.L.E.18-Nov-09 2:33
The Man from U.N.C.L.E.18-Nov-09 2:33 
Questionwindows service error Pin
NarendraSinghJTV17-Nov-09 19:26
NarendraSinghJTV17-Nov-09 19:26 
AnswerRe: windows service error Pin
ScottM117-Nov-09 22:49
ScottM117-Nov-09 22:49 
GeneralRe: windows service error Pin
NarendraSinghJTV17-Nov-09 22:57
NarendraSinghJTV17-Nov-09 22:57 
GeneralRe: windows service error Pin
ScottM117-Nov-09 23:01
ScottM117-Nov-09 23:01 
GeneralRe: windows service error Pin
NarendraSinghJTV17-Nov-09 23:18
NarendraSinghJTV17-Nov-09 23:18 
GeneralRe: windows service error Pin
ScottM117-Nov-09 23:21
ScottM117-Nov-09 23:21 
RantRe: windows service error Pin
NarendraSinghJTV17-Nov-09 23:24
NarendraSinghJTV17-Nov-09 23:24 
GeneralRe: windows service error Pin
ScottM117-Nov-09 23:39
ScottM117-Nov-09 23:39 
GeneralRe: windows service error Pin
NarendraSinghJTV17-Nov-09 23:50
NarendraSinghJTV17-Nov-09 23:50 
GeneralRe: windows service error Pin
ScottM118-Nov-09 0:58
ScottM118-Nov-09 0:58 
GeneralRe: windows service error Pin
NarendraSinghJTV18-Nov-09 1:02
NarendraSinghJTV18-Nov-09 1:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.