Click here to Skip to main content
15,881,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: C# need help reading XML config file with multiple values in windows forms app Pin
J. Calhoun12-Feb-18 10:44
J. Calhoun12-Feb-18 10:44 
GeneralRe: C# need help reading XML config file with multiple values in windows forms app Pin
Travis Jacobson12-Feb-18 10:55
Travis Jacobson12-Feb-18 10:55 
GeneralRe: C# need help reading XML config file with multiple values in windows forms app Pin
J. Calhoun12-Feb-18 11:06
J. Calhoun12-Feb-18 11:06 
QuestionRe: C# need help reading XML config file with multiple values in windows forms app Pin
Travis Jacobson12-Feb-18 11:46
Travis Jacobson12-Feb-18 11:46 
GeneralRe: C# need help reading XML config file with multiple values in windows forms app Pin
Travis Jacobson12-Feb-18 11:48
Travis Jacobson12-Feb-18 11:48 
GeneralRe: C# need help reading XML config file with multiple values in windows forms app Pin
Travis Jacobson12-Feb-18 8:43
Travis Jacobson12-Feb-18 8:43 
AnswerRe: C# need help reading XML config file with multiple values in windows forms app Pin
Dave Kreskowiak12-Feb-18 11:43
mveDave Kreskowiak12-Feb-18 11:43 
QuestionUpdating textbox from derived class c# wpf Pin
Member 1357136412-Feb-18 3:44
Member 1357136412-Feb-18 3:44 
Hi all,

I am trying to develop a C# gui,
having 1 base clase,
a derived class with virtual methods (Parent)
and a further derived class(Child) implementing these methods.

and therefore update a richtextbox on the baseClass from the childClass on button click.

I have created an instance of the childclass in the baseClass,
and have a variable of the baseclass in the childClass like I've seen in some threads online and passed this variable into the constructor of the childClass.

When running the code, it compiles but once the button is clicked, the created variable remains null??

Struggling to figure this out, but I am sure it is some small reason :/

Below is my code I am working with..

namespace Polymorphism
{
    public partial class Base : Window
    {
        private static readonly Base win;
        public static Parent sendr = new Child(win);

        public Base()
        {
            InitializeComponent();
        }
        public void Button_Click(object sender, RoutedEventArgs e)
        {
            string text = "text";
            RtbWrite(text);
        }
        public void RtbWrite(string text)
        {
            sendr.Send(text);
        }
    }
    public class Parent : Base
    {
        public virtual void Send(string text){ }
    }
    class Child : Parent
    {
        public Base win;

        public Child(Base win)
        {
            this.win = win;
        }
        public override void Send(string text)
        {
            win.Rtb.AppendText("Sent");
        }
    }
}

AnswerRe: Updating textbox from derived class c# wpf Pin
Richard MacCutchan12-Feb-18 6:10
mveRichard MacCutchan12-Feb-18 6:10 
AnswerRe: Updating textbox from derived class c# wpf Pin
Gerry Schmitz12-Feb-18 6:21
mveGerry Schmitz12-Feb-18 6:21 
GeneralRe: Updating textbox from derived class c# wpf Pin
Member 1357136412-Feb-18 20:54
Member 1357136412-Feb-18 20:54 
GeneralRe: Updating textbox from derived class c# wpf Pin
Gerry Schmitz13-Feb-18 5:10
mveGerry Schmitz13-Feb-18 5:10 
GeneralRe: Updating textbox from derived class c# wpf Pin
Member 1357136414-Feb-18 9:00
Member 1357136414-Feb-18 9:00 
GeneralRe: Updating textbox from derived class c# wpf Pin
Gerry Schmitz14-Feb-18 10:26
mveGerry Schmitz14-Feb-18 10:26 
QuestionPls Provide me business logic method for reset password or forget password by user id... Pin
Member 1367430012-Feb-18 3:02
Member 1367430012-Feb-18 3:02 
AnswerRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
OriginalGriff12-Feb-18 5:05
mveOriginalGriff12-Feb-18 5:05 
AnswerRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Gerry Schmitz12-Feb-18 6:40
mveGerry Schmitz12-Feb-18 6:40 
GeneralRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Member 1367430012-Feb-18 6:44
Member 1367430012-Feb-18 6:44 
GeneralRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Gerry Schmitz12-Feb-18 6:51
mveGerry Schmitz12-Feb-18 6:51 
GeneralRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Member 1367430012-Feb-18 6:51
Member 1367430012-Feb-18 6:51 
GeneralRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
Gerry Schmitz12-Feb-18 6:59
mveGerry Schmitz12-Feb-18 6:59 
AnswerRe: Pls Provide me business logic method for reset password or forget password by user id... Pin
#realJSOP13-Feb-18 2:05
mve#realJSOP13-Feb-18 2:05 
QuestionStreamwriter only writes one item from textbox Pin
auting8212-Feb-18 2:34
auting8212-Feb-18 2:34 
AnswerRe: Streamwriter only writes one item from textbox Pin
Richard MacCutchan12-Feb-18 5:59
mveRichard MacCutchan12-Feb-18 5:59 
GeneralRe: Streamwriter only writes one item from textbox Pin
auting8212-Feb-18 8:29
auting8212-Feb-18 8:29 

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.