Click here to Skip to main content
15,896,453 members
Home / Discussions / C#
   

C#

 
GeneralRe: Boolean function to return true/false Pin
Member 97041537-Jan-13 12:39
Member 97041537-Jan-13 12:39 
GeneralRe: Boolean function to return true/false Pin
Matt T Heffron7-Jan-13 11:57
professionalMatt T Heffron7-Jan-13 11:57 
GeneralRe: Boolean function to return true/false Pin
Member 97041537-Jan-13 12:02
Member 97041537-Jan-13 12:02 
QuestionC# data tranfer to form in textbox Pin
Member 970663330-Dec-12 2:44
Member 970663330-Dec-12 2:44 
AnswerRe: C# data tranfer to form in textbox Pin
Richard MacCutchan30-Dec-12 4:29
mveRichard MacCutchan30-Dec-12 4:29 
GeneralRe: C# data tranfer to form in textbox Pin
Member 970663330-Dec-12 8:07
Member 970663330-Dec-12 8:07 
GeneralRe: C# data tranfer to form in textbox Pin
Richard MacCutchan30-Dec-12 22:10
mveRichard MacCutchan30-Dec-12 22:10 
AnswerRe: C# data tranfer to form in textbox Pin
BillWoodruff3-Jan-13 17:37
professionalBillWoodruff3-Jan-13 17:37 
Did you want a click on the Button to trigger the reading of the Properties collection, and the writing of some data in each Property to the TextBox ? That's a guess Smile | :)

Let's say you name your Button "WriteQueryCollectionBtn," and your TextBox "PropertyTextBx" ...

In that case, perhaps your Button's Click EventHandler might look like:
C#
private void WriteQueryCollectionBtn_Click(object sender, EventArgs e)
{
    foreach (ManagementObject m in queryCollection)
    {
        if (m.Properties["IsValid"].Value != null
        && m.Properties["IsValid"].Value.ToString() == "True") 
        {
            PropertyTextBx.Text += m.Properties[""].Value.ToString() + Environment.NewLine;
        } 
    }
}
Note that for this code to work in the Form, you would have to also reference the System.Management library with a 'using statement.

It's not clear here if you are going to "connect" and retrieve the data once, when the application starts (as you are doing now), or:

If you are going to want to pull-down the data every time the Button is clicked: my guess is that you'd want to refresh the data each time the Button is clicked, which will require you re-architect your code shown here.

The question here is: does the data change, or is it always the same ?

Again, this reply is pretty much a "blind guess" at what you might want to do. You'll have to be much more specific about your goals here, and the nature of the data, if you want more specific feedback.

good luck, Bill
QuestionHow to solve the following problem using StreamReader. Pin
dr_iton30-Dec-12 0:20
dr_iton30-Dec-12 0:20 
AnswerRe: How to solve the following problem using StreamReader. Pin
Jibesh30-Dec-12 1:19
professionalJibesh30-Dec-12 1:19 
AnswerRe: How to solve the following problem using StreamReader. Pin
Richard MacCutchan30-Dec-12 2:37
mveRichard MacCutchan30-Dec-12 2:37 
GeneralRe: How to solve the following problem using StreamReader. Pin
dr_iton31-Dec-12 14:38
dr_iton31-Dec-12 14:38 
GeneralRe: How to solve the following problem using StreamReader. Pin
Richard MacCutchan31-Dec-12 22:36
mveRichard MacCutchan31-Dec-12 22:36 
GeneralRe: How to solve the following problem using StreamReader. Pin
dr_iton1-Jan-13 8:58
dr_iton1-Jan-13 8:58 
GeneralRe: How to solve the following problem using StreamReader. Pin
Richard MacCutchan1-Jan-13 22:11
mveRichard MacCutchan1-Jan-13 22:11 
GeneralRe: How to solve the following problem using StreamReader. Pin
dr_iton4-Jan-13 10:17
dr_iton4-Jan-13 10:17 
GeneralRe: How to solve the following problem using StreamReader. Pin
Richard MacCutchan5-Jan-13 1:18
mveRichard MacCutchan5-Jan-13 1:18 
GeneralRe: How to solve the following problem using StreamReader. Pin
dr_iton5-Jan-13 2:58
dr_iton5-Jan-13 2:58 
GeneralRe: How to solve the following problem using StreamReader. Pin
Richard MacCutchan5-Jan-13 3:04
mveRichard MacCutchan5-Jan-13 3:04 
QuestionData in GridView is not being displayed correctly Pin
Member 970415329-Dec-12 11:02
Member 970415329-Dec-12 11:02 
AnswerRe: Data in GridView is not being displayed correctly Pin
Lampridis Vasilis29-Dec-12 23:09
Lampridis Vasilis29-Dec-12 23:09 
GeneralRe: Data in GridView is not being displayed correctly Pin
Member 970415329-Dec-12 23:26
Member 970415329-Dec-12 23:26 
GeneralRe: Data in GridView is not being displayed correctly Pin
Lampridis Vasilis29-Dec-12 23:32
Lampridis Vasilis29-Dec-12 23:32 
GeneralRe: Data in GridView is not being displayed correctly Pin
Member 970415329-Dec-12 23:39
Member 970415329-Dec-12 23:39 
GeneralRe: Data in GridView is not being displayed correctly Pin
Jibesh29-Dec-12 23:54
professionalJibesh29-Dec-12 23:54 

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.