Accessing Text Boxes via another class

Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved

Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Accessing Text Boxes via another class

 
0
  #1
Mar 29th, 2009
  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?
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 1,952
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 280
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Posting Virtuoso

Re: Accessing Text Boxes via another class

 
0
  #2
Mar 29th, 2009
What does not work?
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Re: Accessing Text Boxes via another class

 
0
  #3
Mar 29th, 2009
Originally Posted by ddanbe View Post
What does not work?
the buttons don't become invisible and such
Reply With Quote Quick reply to this message  
Join Date: May 2008
Posts: 99
Reputation: FTProtocol has a little shameless behaviour in the past 
Solved Threads: 1
FTProtocol FTProtocol is offline Offline
Junior Poster in Training

Re: Accessing Text Boxes via another class

 
0
  #4
Mar 29th, 2009
Originally Posted by FTProtocol View Post
the buttons don't become invisible and such
Solved

  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. }
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC