.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

Changing label's properties by coding ???(VS studio 2010 )

Posted By: small_chick     Posted Date: July 19, 2012    Points:5   Category :Windows Application
I've try to change label's properties by coding.When I had clicked debug=>starting debugging, the properties didn't change.
I hope sommeone can help me! thanks!
this is my code:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WindowsFormsApplication
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}

private void Form1_Load(object sender, EventArgs e)
{
label1.Text = "This is my first Lable";
label1.BorderStyle = BorderStyle.Fixed3D;
label1.TextAlign = ContentAlignment.MiddleCenter;
}
}
}

Responses
Author: RAJ             
Posted Date: July 20, 2012     Points: 20   

Hi,
the above code is working fine. the label properties changed when we click on start debugging
please check it once agin in vs2010

Regards
--------
Raju
Author: small_chick             
Posted Date: July 21, 2012     Points: 20   

I have fixed my code, I think the problem here is that I used "private void Form1_Load", it may mean that there must be an event to come into this function !
When I put these directions:
< label1.Text = "This is my first Lable";
label1.BorderStyle = BorderStyle.Fixed3D;
label1.TextAlign = ContentAlignment.MiddleCenter; >
//*********************************
into function "public Form1()", it worked well !
Is my explaination above right ?



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend