User Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a user control that I want to retrieve a property that is a string. I want to know how to have the property only allow the two strings I have specified to be selected. Then I want to set the response as another string so that I can refer to it. Thank You

/
// Determines whether or not to use parent forms transparency value, or specified value
/
string p = "Parent Form"
string sv = "Specified Value"
public string WhichValu

get{return ;
set{ ; Invalidate();
}
 
Insteed of string use enum of these two strings, and the property should be of that enum type.
 
I have no idea what that means... Could you give me an example? Thanks

----- MS wrote: ----

Insteed of string use enum of these two strings, and the property should be of that enum type.
 
Consider using a boolean for this case.

public bool IsParentForm
{
get
{
return isParentForm;
}

set
{
isParentForm = value;
Invalidate();
}
}

Based on if the value is set or not, you can use the other property you
mentioned.

-vJ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top