开发者

How to access variables of a referenced class library in a Winforms application

I have a Windows Forms application with a reference for the class library in my Win-forms project.

  1. The win-form has a combo-box and a button.
  2. the class library has a global variable value1,value2 and other code which depending on value1 executes some code.

In win-form i make a selection in the combo-box and on button click depending on the selection made i should assign a value to the variable "value1" of class library as value = true . i created an instance of the class library as classlibraryname clb = new classlibrary() but after that i am no开发者_如何学编程t able to assign true to the class library variable "value1" .

how can i assign a value to variable value1???

I am new to working with c# and class libraries .please help


Declare your variable in the class library as public

    public bool variable1;

Then in your winform do the following:

    classlibraryname clb = new classlibraryname();
    clb.variable1 = true;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜