943,697 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Marked Solved
  • Views: 761
  • C# RSS
Mar 29th, 2009
0

Accessing Text Boxes via another class

Expand Post »
C# Syntax (Toggle Plain Text)
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace bPod
  6. {
  7. public class PodCastFunctions : Form1
  8. {
  9. public void ClearOriginal()
  10. {
  11. newpodcastButton.Visible = false;
  12. addpodcastButton.Visible = false;
  13. finalisepodcastButton.Visible = false;
  14. overviewButton.Visible = false;
  15.  
  16. this.Height = 183;
  17. this.Width = 671;
  18. this.BackgroundImage = Properties.Resources.NewPCast;
  19.  
  20. podcastdescLabel.Visible = true;
  21. podcastdescTextBox.Visible = true;
  22. podcastnameLabel.Visible = true;
  23. podcastnameTextBox.Visible = true;
  24. podcastdetailsButton.Visible = true;
  25. }
  26.  
  27. public void DrawOriginal()
  28. {
  29. podcastdescLabel.Visible = false;
  30. podcastdescTextBox.Visible = false;
  31. podcastnameLabel.Visible = false;
  32. podcastnameTextBox.Visible = false;
  33. podcastdetailsButton.Visible = false;
  34.  
  35. newpodcastButton.Visible = true;
  36. addpodcastButton.Visible = true;
  37. finalisepodcastButton.Visible = true;
  38. overviewButton.Visible = true;
  39.  
  40. this.Height = 624;
  41. this.Width = 670;
  42. this.BackgroundImage = Properties.Resources.Background;
  43. }
  44. }
  45. }

why does this not work?
Similar Threads
Reputation Points: -14
Solved Threads: 1
Junior Poster in Training
FTProtocol is offline Offline
99 posts
since May 2008
Mar 29th, 2009
0

Re: Accessing Text Boxes via another class

What does not work?
Reputation Points: 2023
Solved Threads: 644
Senior Poster
ddanbe is offline Offline
3,736 posts
since Oct 2008
Mar 29th, 2009
0

Re: Accessing Text Boxes via another class

Click to Expand / Collapse  Quote originally posted by ddanbe ...
What does not work?
the buttons don't become invisible and such
Reputation Points: -14
Solved Threads: 1
Junior Poster in Training
FTProtocol is offline Offline
99 posts
since May 2008
Mar 29th, 2009
0

Re: Accessing Text Boxes via another class

Click to Expand / Collapse  Quote originally posted by FTProtocol ...
the buttons don't become invisible and such
Solved

C# Syntax (Toggle Plain Text)
  1. public void ClearOriginal()
  2. {
  3. Form1 form1Form = (Form1)Application.OpenForms["Form1"];
  4. Button newpodcastButton = (Button)form1Form.Controls["newpodcastButton"];
  5. Button addpodcastButton = (Button)form1Form.Controls["addpodcastButton"];
  6. Button finalisepodcastButton = (Button)form1Form.Controls["finalisepodcastButton"];
  7. Button overviewButton = (Button)form1Form.Controls["overviewButton"];
  8. Label podcastnameLabel = (Label)form1Form.Controls["podcastnameLabel"];
  9. Label podcastdescLabel = (Label)form1Form.Controls["podcastdescLabel"];
  10. TextBox podcastnameTextBox = (TextBox)form1Form.Controls["podcastnameTextBox"];
  11. TextBox podcastdescTextBox = (TextBox)form1Form.Controls["podcastdescTextBox"];
  12. Button podcastdetailsButton = (Button)form1Form.Controls["podcastdetailsButton"];
  13.  
  14. newpodcastButton.Visible = false;
  15. addpodcastButton.Visible = false;
  16. finalisepodcastButton.Visible = false;
  17. overviewButton.Visible = false;
  18.  
  19. form1Form.Height = 183;
  20. form1Form.Width = 671;
  21. form1Form.BackgroundImage = Properties.Resources.NewPCast;
  22.  
  23. podcastdescLabel.Visible = true;
  24. podcastnameLabel.Visible = true;
  25. podcastdescTextBox.Visible = true;
  26. podcastnameTextBox.Visible = true;
  27. podcastdetailsButton.Visible = true;
  28. }
Reputation Points: -14
Solved Threads: 1
Junior Poster in Training
FTProtocol is offline Offline
99 posts
since May 2008

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Derived CheckBox does not show
Next Thread in C# Forum Timeline: Connection in windows application





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC