| | |
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 |
Tag cloud for C#
.net access algorithm array barchart bitmap box buttons c# chat check checkbox class client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees draganddrop drawing encryption enum event excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






