Wrox Programmer Forums
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 22nd, 2003, 10:10 PM
Registered User
 
Join Date: Dec 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Get Set

Does anyone see what's wrong with this

public string SelectedDate
{
   get
   {
    switch (dDate == txtSelectedDate.Text){}
   }
   set
   {
    txtSelectedDate.Text = value.Replace(" ", "") ;
   }
}
End Get ;
Set(ByVal string) Value ;
   txtSelectedDate.Text = Value.Replace(" ", "") ;
End Set ;
End Property ;


Thank you,
Tina

 
Old December 23rd, 2003, 04:58 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

You're mixing up languages. End Get, End Property etc are VB.NET constructs.
In C# a property looks like this:
Code:
public string SelectedDate
{
  get
  {
    return m_selectedDate;
  }
  set
  {
    m_selectedDate = value;
  }
}
That's all that's necessary for a single property. What exactly are you trying to do??

Imar


---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
XPath: set operation with a disjoint node set rich_unger XSLT 7 May 6th, 2008 09:24 AM
how to set .... rupen Classic ASP Basics 8 February 23rd, 2007 06:24 PM
how to set .... rupen CSS Cascading Style Sheets 1 January 16th, 2007 01:14 AM
how i set charcter set to a connection yoord BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 April 23rd, 2005 07:47 AM
How to set DOM character set sonicDace XML 0 May 27th, 2004 08:52 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.