1 Replies - 299 Views - Last Post: 24 July 2015 - 07:14 AM Rate Topic: -----

#1 hami_78  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 40
  • Joined: 10-July 15

how can i add a true / false property to my usercontrol

Posted 24 July 2015 - 07:05 AM

how can i add a true / false property to my usercontrol

Posted Yesterday, 03:59 AM
hi guys
i have made a textbox_usercontrol
i wanna add a property named it null_sensitiveand set it with true false
when is in true mode it do some actions forexample foreground set to red and mesaged to user
and in false mode (default)no actions
i made a simple string property for my usercontrol (you can see in code behind) but i really get confused by bool propery...
<UserControl x:Class="WpfApplication1.mytextbox_usercontrol"
02	             ....">
08	    <Grid  Height="auto"  Width="auto" >
09	        <TextBox   x:Name="txt1"  Foreground="DarkBlue"  FontSize="13" FontWeight="Bold" FlowDirection="LeftToRight" VerticalContentAlignment="Center" Width="AUTO" Height="AUTO"  >
10	 
11	 
12	        </TextBox>
13	    </Grid>
14	</UserControl>



01

code behinde codes
namespace WpfApplication1
02	{
03	    /// <summary>
04	    /// Interaction logic for mytextbox_usercontrol.xaml
05	    /// </summary>
06	    public partial class mytextbox_usercontrol : UserControl
07	    {
08	        public latin_usercontrol()
09	        {
10	            InitializeComponent();
11	        }
12	        public string textme
13	        {
14	            get
15	            {
16	                return txt1.Text;
17	            }
18	            set
19	            {
20	                txt1.Text = value;
21	            }
22	        }
23	    public bool sensitive_null
24	        {
25	       ?//idont know how use get and set here //
26	        }
27	 
28	 
29	    }
30	}

01

thank you

Is This A Good Question/Topic? 0
  • +

Replies To: how can i add a true / false property to my usercontrol

#2 modi123_1  Icon User is offline

  • Suitor #2
  • member icon



Reputation: 13561
  • View blog
  • Posts: 54,110
  • Joined: 12-June 08

Re: how can i add a true / false property to my usercontrol

Posted 24 July 2015 - 07:14 AM

Please do not create duplicate topics. Closing.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1