| | |
Accessing Text Boxes via another class
Please support our C# advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: May 2008
Posts: 99
Reputation:
Solved Threads: 1
C# Syntax (Toggle Plain Text)
using System; using System.Collections.Generic; using System.Text; namespace bPod { public class PodCastFunctions : Form1 { public void ClearOriginal() { newpodcastButton.Visible = false; addpodcastButton.Visible = false; finalisepodcastButton.Visible = false; overviewButton.Visible = false; this.Height = 183; this.Width = 671; this.BackgroundImage = Properties.Resources.NewPCast; podcastdescLabel.Visible = true; podcastdescTextBox.Visible = true; podcastnameLabel.Visible = true; podcastnameTextBox.Visible = true; podcastdetailsButton.Visible = true; } public void DrawOriginal() { podcastdescLabel.Visible = false; podcastdescTextBox.Visible = false; podcastnameLabel.Visible = false; podcastnameTextBox.Visible = false; podcastdetailsButton.Visible = false; newpodcastButton.Visible = true; addpodcastButton.Visible = true; finalisepodcastButton.Visible = true; overviewButton.Visible = true; this.Height = 624; this.Width = 670; this.BackgroundImage = Properties.Resources.Background; } } }
why does this not work?
•
•
Join Date: May 2008
Posts: 99
Reputation:
Solved Threads: 1
Solved
C# Syntax (Toggle Plain Text)
public void ClearOriginal() { Form1 form1Form = (Form1)Application.OpenForms["Form1"]; Button newpodcastButton = (Button)form1Form.Controls["newpodcastButton"]; Button addpodcastButton = (Button)form1Form.Controls["addpodcastButton"]; Button finalisepodcastButton = (Button)form1Form.Controls["finalisepodcastButton"]; Button overviewButton = (Button)form1Form.Controls["overviewButton"]; Label podcastnameLabel = (Label)form1Form.Controls["podcastnameLabel"]; Label podcastdescLabel = (Label)form1Form.Controls["podcastdescLabel"]; TextBox podcastnameTextBox = (TextBox)form1Form.Controls["podcastnameTextBox"]; TextBox podcastdescTextBox = (TextBox)form1Form.Controls["podcastdescTextBox"]; Button podcastdetailsButton = (Button)form1Form.Controls["podcastdetailsButton"]; newpodcastButton.Visible = false; addpodcastButton.Visible = false; finalisepodcastButton.Visible = false; overviewButton.Visible = false; form1Form.Height = 183; form1Form.Width = 671; form1Form.BackgroundImage = Properties.Resources.NewPCast; podcastdescLabel.Visible = true; podcastnameLabel.Visible = true; podcastdescTextBox.Visible = true; podcastnameTextBox.Visible = true; podcastdetailsButton.Visible = true; }
![]() |
Similar Threads
- Help Needed with GUI (Java)
Other Threads in the C# Forum
- Previous Thread: Derived CheckBox does not show
- Next Thread: Connection in windows application
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# c#gridviewcolumn check checkbox client color combobox communication control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing elevated encryption enum event excel file focus forloop form format forms function gdi+ hospitalmanagementsystem httpwebrequest image index input install java label list listbox login mandelbrot math messagebox mouseclick mysql operator path photoshop picturebox pixelinversion plotting post programming radians read regex remote remoting richtextbox serialization server sleep socket sql statistics stream string stringformatting sun table text textbox thread time timer update usercontrol validation visualstudio webbrowser whileloop windows winforms wpf xml






