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
csc 0
NA
1
0
Updating form after making changes to controls
Jun 22 2004 6:15 PM
Hi, I have a namespace containing two classes. One class handles the form generation and has a method for changing the text in a combobox. The other class gets info from the registry. I have created an instance of the first class within the second class, used this to access the method. It appears to work because a console writeline gives me the correct value for the text before update so I know the value is getting through. Also a messagebox after the text change gives the correct value. Can someone please tell me how to 'refresh' the form on the screen? Code (severely edited to save space below) namespace AVMonitor { public class FormUserInfo : System.Windows.Forms.Form { public void settboCurrentDatVerText(string strCurrentDatVer) { Console.WriteLine(strCurrentDatVer); this.tboCurrentDatVer.Text = strCurrentDatVer; MessageBox.Show(tboCurrentDatVer.Text); this.Refresh(); Application.DoEvents(); } } public class AVDetails { public static void Main() { AVMonitor.FormUserInfo FUI = new FormUserInfo(); //? apply values to form FUI.settboCurrentDatVerText("test"); Application.Run(new FormUserInfo()); } } }
Reply
Answers (
1
)
Accessing the message loop
How to use listbox in windows form