Click here to Skip to main content
15,926,290 members
Home / Discussions / C#
   

C#

 
GeneralRe: Current Path in C# Pin
Stefan Troschuetz11-Apr-04 21:29
Stefan Troschuetz11-Apr-04 21:29 
GeneralRe: Current Path in C# Pin
Tom Larsen12-Apr-04 5:06
Tom Larsen12-Apr-04 5:06 
GeneralRe: Current Path in C# Pin
Heath Stewart12-Apr-04 5:10
protectorHeath Stewart12-Apr-04 5:10 
GeneralCustom attribute in Active Directory user account Pin
hd4478011-Apr-04 20:29
hd4478011-Apr-04 20:29 
GeneralRe: Custom attribute in Active Directory user account Pin
Mazdak11-Apr-04 20:58
Mazdak11-Apr-04 20:58 
GeneralRe: Custom attribute in Active Directory user account Pin
Heath Stewart12-Apr-04 5:32
protectorHeath Stewart12-Apr-04 5:32 
GeneralRe: Custom attribute in Active Directory user account Pin
hd4478012-Apr-04 7:07
hd4478012-Apr-04 7:07 
QuestionIs it possible to split a class into several files ? Pin
Andres Coder11-Apr-04 20:11
Andres Coder11-Apr-04 20:11 
AnswerRe: Is it possible to split a class into several files ? Pin
Colin Angus Mackay11-Apr-04 23:42
Colin Angus Mackay11-Apr-04 23:42 
GeneralMDI Client Area Color Pin
Riaan van der Westhuizen11-Apr-04 20:08
Riaan van der Westhuizen11-Apr-04 20:08 
GeneralRe: MDI Client Area Color Pin
STW11-Apr-04 22:45
STW11-Apr-04 22:45 
GeneralAudio & Video chat Pin
Member 33502211-Apr-04 19:27
Member 33502211-Apr-04 19:27 
GeneralRe: Audio & Video chat Pin
DucLinh11-Apr-04 23:53
DucLinh11-Apr-04 23:53 
GeneralRe: Audio & Video chat Pin
Anonymous30-May-04 17:05
Anonymous30-May-04 17:05 
GeneralEmbedding VC++.NET code in VC#.NET Project Pin
Nagendra Kamath K11-Apr-04 19:06
Nagendra Kamath K11-Apr-04 19:06 
GeneralRe: Embedding VC++.NET code in VC#.NET Project Pin
Jesse Squire12-Apr-04 2:13
Jesse Squire12-Apr-04 2:13 
GeneralImage trnasfer using Remoting Pin
Nagendra Kamath K11-Apr-04 19:03
Nagendra Kamath K11-Apr-04 19:03 
GeneralRe: Image trnasfer using Remoting Pin
Heath Stewart12-Apr-04 5:35
protectorHeath Stewart12-Apr-04 5:35 
Generaldatagrid cell updates Pin
DougW4811-Apr-04 19:01
DougW4811-Apr-04 19:01 
GeneralRe: datagrid cell updates Pin
Mazdak11-Apr-04 21:40
Mazdak11-Apr-04 21:40 
GeneralBlocking Task Keys Pin
Nagendra Kamath K11-Apr-04 18:01
Nagendra Kamath K11-Apr-04 18:01 
GeneralRe: Blocking Task Keys Pin
Heath Stewart12-Apr-04 5:38
protectorHeath Stewart12-Apr-04 5:38 
GeneralRe: Blocking Task Keys Pin
Nagendra Kamath K12-Apr-04 7:17
Nagendra Kamath K12-Apr-04 7:17 
GeneralRe: Blocking Task Keys Pin
Heath Stewart12-Apr-04 8:23
protectorHeath Stewart12-Apr-04 8:23 
QuestionControl question??? Pin
Small Rat11-Apr-04 17:15
Small Rat11-Apr-04 17:15 
I got a question:
Q: You use Visual Studio.net to create a windows form named Form1, you add a custom control named BarGraph, which displays numerical data. You create a second custom control named DataBar. Each instance of DataBar represent one data value in BarGraph.
BarGraph retrieves its data from a Microsoft SQL Server database. for each data value that it retrieves a new instance of DataBar is added to BarGraph. BarGrahp also includes a Label control named DataBarCount, which displays the number of DataBar controls currently contained by BarGraph.
You must add code to one of yor custome controls to ensure that DataBarCount is always updated with the correct value.
What are two possible ways to achieve this goal?(Each correct answer presents a complete solutins.Choose two).

And I got the so-called two correct answers:

A1:Add the following code segment to the ControlAdded event handler for BarGraph:
DataBarCount.Text=this.Controls.Count;

A2:Add the following code segment to the constructor for DataBar:
this.Parent.DataBarCount.Text=this.Controls.Count;


I don't understant why?
who can explain why they are right????

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.