TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Nel
NA
716
1.1m
Object reference not set to an instance of an object.
Jun 25 2012 7:08 AM
Hi,
I want to check the value of the combobox in one form from another.
I have this code in button2_Click event
Blagajna bl = (Blagajna)Application.OpenForms["Blagajna"];
ComboBox cb = (ComboBox)bl.Controls["comboBoxVal"];
String kom = (cb.SelectedItem).ToString();
and
Blagajna bl = new Blagajna();
in partial class definition.
I get this errorr: "Object reference not set to an instance of an object."
Could anybody help me please what is the problem with the code?
Thanks in advance.
Reply
Answers (
7
)
Advantage of Private constructor in C#
Date Formate