473,396 Members | 1,966 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

create an instance of form into non form class to access button/label

Hi,
I have a non form class. I want to update label/ check status of check box etc.. in non form class ( here resides functions that contains logic). How can i do that ?
Nov 23 '14 #1
4 1570
Frinavale
9,735 Expert Mod 8TB
Labels, CheckBoxes etc. are graphical user interface controls that let the end user interact with your system.

If you do not have a form, then what do you have as a graphical user interface?

-Frinny
Nov 24 '14 #2
I have an form that contains label, 2 buttons and. Check box. I have separated a logic in to another class ( non form class ). I want to update the status of operation ( which is being executed in non form class) in to form label also activate some buttons. But not effective. I made all components public from private. Created an object of form class then accessed the elements. Ex :
Expand|Select|Wrap|Line Numbers
  1. formclass objformclass = new formclass ();
  2. Objformclass.lbl1.text = " text updated";
  3. similarly, objformclass.btn=true;
No error on compilation but not effective.
* msg sent from mbl, excuse if spelling mistakes *
Nov 24 '14 #3
Frinavale
9,735 Expert Mod 8TB
Well, you could implement the INotifyPropertyChanged Interface and raise property changed notification events every time a property is changed.

Then in your form's code-behind you could catch the property changed events and update the GUI controls that correspond to the property that was changed.



-Frinny
Nov 24 '14 #4
Can you give me small example? ( this is my first C# programme )
Nov 25 '14 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: MKoleoso | last post by:
Problem: C#- Unable to create instance of a class implementing from an interface I have: namespace someNamespace { public __gc class SomeClass1 { }
0
by: Sinisa | last post by:
I have a Windows form which has multiple groups of the same window controls. I wanted to create a control class that has the standard controls in one. something like: public class Sensor :...
3
by: Scott Schade | last post by:
I have a form onto which I add a control during execution. The control is a control that I wrote. The control has a number of controls on it. I would like to click on a button on the control and...
39
by: Quick Fox | last post by:
Hi All, Please help for following case: How to Load a Assembly from DLL file and create instance of the class in the loaded file. I want make a function that get 2 string parameters...
6
by: Max | last post by:
Last time I tried to explain this on another forum it didn't go too well, so I'll try my best and if you know what I'm talking about then please tell me how to do this. I have a class, inside I...
2
by: Dennis | last post by:
I want to pass a variable to a Procedure and have that function instantiate an instance of that class. For example, I have a Class named "myClass": CreateInstance ("myClass") Sub...
8
by: kevin | last post by:
I have a form and in the form I have a sub that uses a class I instantiate using visual basic code: Public oCP As New Rs232 'instantiate the comm port I need to share this sub with...
5
by: mlev | last post by:
I want function in one namespace to create instance of class defined in another namespace. (more detailed - I try to make independent "Seralizer" dll, to be used by different application, each...
1
by: Michael Lev | last post by:
For a class (let's call it Config ) not defined/known in my code, I want create an instance. Specifically, something like: Config config = (Config)serializer.Deserialize(stream); Which...
1
by: Adeel Khan | last post by:
I am working in eclipse and i am getting this error I pass arraylist from servlet with request.setAttribute("myArray',col_role) col_role contain object(role) role is class name
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.