473,803 Members | 3,857 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

C# issues with controls not showing up

1 New Member
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_Cli ck(object sender, EventArgs e){

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

(inside game class)

public void StartGame(){
board.HideLabel s()
}

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 3776
JosAH
11,448 Recognized Expert MVP
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
1586
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. This program do nothing more than showing a button "Start thread". When it is pushed, a new thread is started in which a usercontrol is created, showing another button. That's all. Everything works, but, when like this source code I put the line...
1
2179
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 form as required. All my controls are setup similar to the following: private System.Windows.Forms.ListBox listBox1; private System.Windows.Forms.TabControl tabControl1;
4
2192
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 news group answers. Some say "Crystal Reports", others say "PDF" or "Word", and others say that you cannot do this at all on client side??? My reports are text documents that are already formatted, contain form feeds, and positioning controls...
6
2239
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 corrent number of controls. The problem is that they appear next to each other. I want to create the controls with some wording to the left of them (again, dynamically generated). Normally id use <table> with two colums, one for the
3
1507
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. /// <summary> /// Render this control to the output parameter specified.
10
3097
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 config does specify a machinekey setting: <machineKey validationKey="447C05E8B3A71401CC4CAE5513A7F1A3494A3618EE819316AAD1D58433F236A759D66FB4154500E01EB4E1BC1DE42046E2D652D391CB8367A1649438867A02EB"...
1
1845
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 asp.net web controls. I searched for articles on the internet and in the end I must say that I'm confused. I read about issues related to: a.. events not firing
3
6288
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 not being called, even if the “__EVENTTARGET” value from the post collection was the same as the UniqueID of my control. After a while i discovered that the event was raised but for another control in the page. I read the msdn documentation on the...
1
2115
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 "http://localhost/..." In user registration form I included validation controls (Required, comparer, ..) in my machine validation controls showing error messages
0
9700
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10310
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10068
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7603
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6841
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5498
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5627
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3796
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2970
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.