| | |
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 activedirectory ado.net algorithm array barchart bitmap box broadcast buttons c# check checkbox client combobox connect control conversion cryptographyc#winformsencryption csharp custom database datagrid datagridview dataset datetime degrees development disabled displayingopenforms draganddrop drawing encryption enum event excel file foreach form format forms ftp function gdi+ httpwebrequest image index index-error input install java label list listbox mandelbrot math mathematics mouseclick mysql operator path photoshop picturebox pixelinversion post prime programming radians regex remote remoting richtextbox security server setup sleep socket sql statistics stream string table text textbox thread time timer totaldays update user usercontrol validation visual visualstudio webbrowser windows winforms wpf xml






