473,406 Members | 2,217 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

C# issues with controls not showing up

Hi,

So i created a form called board. and on this form placed a whole heap of labels, buttons and a menu. Now from the menu there is a New Game option. When this is clicked a new form is opened called New Game. once you are finished filling in details the New Game form disappears. The board form is still there, has always been there but now i want certain labels to turn invisible.

so in the board class i have all the VS2005 code making all the stuff and in the New Game form i have a button click event that makes the New Game form hide and calls a method called game.StartGame();

the new game form disappears alright and the code keeps going but the labels i want to change don't go invisible. I also create a button that doesn't show up either. i use the board.Controls.Add(button); and i ended up creating a method called HideLabels. code is as follows

(inside board class)
public void HideLabels(){
lblName.Visible = false;
}

(inside new game class)
private void btnPlayerOK_Click(object sender, EventArgs e){

game.StartGame();
this.Hide();
}

(inside game class)

public void StartGame(){
board.HideLabels()
}

now i know the code reads the HideLabels cod ebecuase i tested by asking it to open a message box after the visible = false. the message box appeared but the label was still there.

Why? and why doesn't my buttons show up even though i add them?

thanks in advance
Oct 25 '08 #1
1 3754
JosAH
11,448 Expert 8TB
This is the C and C++ forum; those languages have nothing to do with C#. Do you
want me to move your question over to the .NET forum where C# questions are asked?

kind regards,

Jos (moderator)
Oct 25 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Ludovic SOEUR | last post by:
Have everyone tried to create controls in separated threads ? I have a problem that I do not understand. To simplify the explanations, I wrote theses few lines to show an example of the problem....
1
by: MikeB | last post by:
I am using GetEnumerator for determining how many ListBox controls exist on a form and then binding each of them to a datasource. This is required as I need to add more Listbox controls to the...
4
by: Russ | last post by:
To ASP.NET printing experts: My Asp.net web form needs to print some reports at the client side. I've been trying to research this and find some confusing and conflicting information in previous...
6
by: dhnriverside | last post by:
Hi peeps, I'm trying to create some controls textboxes at runtime, based on the number of items in a IETreeView that are checked. That I can do, I've got a place holder and I can create the...
3
by: msnews.microsoft.com | last post by:
Hello All, I am trying to write Web Controls and in most of the samples I came across, I am seeing the following function where a HTML string is written to create HTML Controls. ///...
10
by: Robert | last post by:
I have an app that was originally 1.1, now migrated to 2.0 and have run into some sporadic viewstate errors...usually saying the viewstate is invalid, eventvalidation failed or mac error. My web...
1
by: Bob Rock | last post by:
Hello, I'm new to ASP.NET and I've been looking into the topic of dynamically loading (typically accomplished with a LoadControl followed by a MyControl.Controls.Add()) both user controls and...
3
by: Trex | last post by:
ASP.NET RaisePostbackEvent Issues I ran into some problems on a particular page in an application. Only on that page, for the same control that worked in other pages, the RaisePostbackEvent was...
1
by: nRk | last post by:
Hi, I am working on asp.net 2.0 with Visual Studio 2005. My asp.net project contains one Masterpage. I exposed my asp.net project in my machine (Windows XP with IIS 5.1) and access using...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.