Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. "dot"

"dot"

Scheduled Pinned Locked Moved C#
questioncsharphelp
11 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    new2pgrmg
    wrote on last edited by
    #1

    Hi, This may sound very silly but please do help me to understand… In C# we write Textbox1.text=”hello” My question is regarding the “”DOT”” what is its name and what is its functionality…. Now in this code how does the dot work… obj.delegateobject = new windowsdelegates.Form2.nameofdelegate(SetText); is it something that we use to pass values ????? I am new to prgrmng and need you guys help… Thanking you k

    C A 2 Replies Last reply
    0
    • N new2pgrmg

      Hi, This may sound very silly but please do help me to understand… In C# we write Textbox1.text=”hello” My question is regarding the “”DOT”” what is its name and what is its functionality…. Now in this code how does the dot work… obj.delegateobject = new windowsdelegates.Form2.nameofdelegate(SetText); is it something that we use to pass values ????? I am new to prgrmng and need you guys help… Thanking you k

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      At this point, you really don't know enough to be able to seek help here. I trust you are at school, and not being paid for your efforts. You should buy a book on C# and work through it. There's really no way that forum responses are going to help you much, because every answer you get is just going to raise more questions. Get a book, and work through it in a structured way. The answer is that Textbox1 is a class, and text is a property of that class. The dot means that you're accessing a property or method of a class instance.

      Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      K 1 Reply Last reply
      0
      • C Christian Graus

        At this point, you really don't know enough to be able to seek help here. I trust you are at school, and not being paid for your efforts. You should buy a book on C# and work through it. There's really no way that forum responses are going to help you much, because every answer you get is just going to raise more questions. Get a book, and work through it in a structured way. The answer is that Textbox1 is a class, and text is a property of that class. The dot means that you're accessing a property or method of a class instance.

        Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

        K Offline
        K Offline
        kabutar
        wrote on last edited by
        #3

        thankyou sir....:) i am looking for a book that is simple to understand since this is my fiorst step to pgrmg

        C#

        C 1 Reply Last reply
        0
        • K kabutar

          thankyou sir....:) i am looking for a book that is simple to understand since this is my fiorst step to pgrmg

          C#

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          http://www.amazon.com/s/ref=nb_ss_gw/104-7566679-9297512?initialSearch=1&url=search-alias%3Daps&field-keywords=C%23+24+hours[^] The first two books on this list ( both teach yourself C# in 24 hours ) should be a good starting point ( obviously buy just one ). This site is great if you get stuck on something specific, if something is not clear to you. But, you should start with the book, and use the site when something needs further explanation. That will give you the best result.

          Christian Graus - Microsoft MVP - C++ "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          1 Reply Last reply
          0
          • N new2pgrmg

            Hi, This may sound very silly but please do help me to understand… In C# we write Textbox1.text=”hello” My question is regarding the “”DOT”” what is its name and what is its functionality…. Now in this code how does the dot work… obj.delegateobject = new windowsdelegates.Form2.nameofdelegate(SetText); is it something that we use to pass values ????? I am new to prgrmng and need you guys help… Thanking you k

            A Offline
            A Offline
            azifaliazif
            wrote on last edited by
            #5

            Well i believe u must be familiar with properties and functions. Every object of any class has some properties and methods. e.g class MyClass { int i; string j; void MyClass(){}//this is constructor Public void MyMethod( int x )//this is member function { return x*x; } } Now if i make an object of this class MyClass obj = new MyClass();//Notice I called the constructor. Because obj is an instance of MyClass so it must have a cope of i,j and MyMethod(int x) of its own. So what i should do to access these properties(i,j) or member function of MyClass.............Here is wat i would do. obj.i=9;//so i m using dot to access the properties of the object. obj.MyFunction(8);//Here i m calling the member functon. Now to the code u provided. obj.delegateobject = new windowsdelegates.Form2.nameofdelegate(SetText); Look at this in pieces obj is an object of any class this class must have some property delegateobject we are assigning this property(delegateobject) an object of class form2 by setting its name "Set Text". So here is the moral lesson dot is also used to access classes within a namespace. I will recomend u so hav some good book on C#.NET for beginner level. u will get the answers to most of ur questions.

            S N 2 Replies Last reply
            0
            • A azifaliazif

              Well i believe u must be familiar with properties and functions. Every object of any class has some properties and methods. e.g class MyClass { int i; string j; void MyClass(){}//this is constructor Public void MyMethod( int x )//this is member function { return x*x; } } Now if i make an object of this class MyClass obj = new MyClass();//Notice I called the constructor. Because obj is an instance of MyClass so it must have a cope of i,j and MyMethod(int x) of its own. So what i should do to access these properties(i,j) or member function of MyClass.............Here is wat i would do. obj.i=9;//so i m using dot to access the properties of the object. obj.MyFunction(8);//Here i m calling the member functon. Now to the code u provided. obj.delegateobject = new windowsdelegates.Form2.nameofdelegate(SetText); Look at this in pieces obj is an object of any class this class must have some property delegateobject we are assigning this property(delegateobject) an object of class form2 by setting its name "Set Text". So here is the moral lesson dot is also used to access classes within a namespace. I will recomend u so hav some good book on C#.NET for beginner level. u will get the answers to most of ur questions.

              S Offline
              S Offline
              sujithkumarsl
              wrote on last edited by
              #6

              well, i just run thru the question, here you declared int i, and string j.. both are private members in class MyClass. you can keep the cariables as public if you want to access it. If you want to access the private members dotnet provides another techique... "property".. in which you have more control.... like private int i; public int I { set // get // }

              My small attempt...

              W 1 Reply Last reply
              0
              • S sujithkumarsl

                well, i just run thru the question, here you declared int i, and string j.. both are private members in class MyClass. you can keep the cariables as public if you want to access it. If you want to access the private members dotnet provides another techique... "property".. in which you have more control.... like private int i; public int I { set // get // }

                My small attempt...

                W Offline
                W Offline
                wrzhi_2005
                wrote on last edited by
                #7

                sorry sir,is there any relationship between i&I? just like this: class Distance { float start,finish; public float Start//can i write it as start? { get{return start;} set{if(start>=0)start=value} } ... } public class MainClass { public static void Main() { Distance d=new Distance(); d.Start=5 Console.WriteLine(d.start) } } Is there a really value of Start which equals start?which word gives the Start a value?i'm sorry,my english is so bad ,I don't know whether you got my mind or not. 另:祝天天快乐。:)

                S 1 Reply Last reply
                0
                • W wrzhi_2005

                  sorry sir,is there any relationship between i&I? just like this: class Distance { float start,finish; public float Start//can i write it as start? { get{return start;} set{if(start>=0)start=value} } ... } public class MainClass { public static void Main() { Distance d=new Distance(); d.Start=5 Console.WriteLine(d.start) } } Is there a really value of Start which equals start?which word gives the Start a value?i'm sorry,my english is so bad ,I don't know whether you got my mind or not. 另:祝天天快乐。:)

                  S Offline
                  S Offline
                  sujithkumarsl
                  wrote on last edited by
                  #8

                  heii dont worry what you wrote was correct.... the thing is simple that, private members cant access from out side the class.. thats why you got error earlier........ :) now to access that private members, we can use "Property", that is what you exactly did... usually we declare the member with small letter and Property with Capitol letter as float start; and public float Start { }

                  My small attempt...

                  W 1 Reply Last reply
                  0
                  • S sujithkumarsl

                    heii dont worry what you wrote was correct.... the thing is simple that, private members cant access from out side the class.. thats why you got error earlier........ :) now to access that private members, we can use "Property", that is what you exactly did... usually we declare the member with small letter and Property with Capitol letter as float start; and public float Start { }

                    My small attempt...

                    W Offline
                    W Offline
                    wrzhi_2005
                    wrote on last edited by
                    #9

                    yeah,I got lots of things from you,thanks again.:)

                    S 1 Reply Last reply
                    0
                    • W wrzhi_2005

                      yeah,I got lots of things from you,thanks again.:)

                      S Offline
                      S Offline
                      sujithkumarsl
                      wrote on last edited by
                      #10

                      okie okie..... Just try to get some books of C# and start.. otherwise you will get these kind of questions soon

                      My small attempt...

                      1 Reply Last reply
                      0
                      • A azifaliazif

                        Well i believe u must be familiar with properties and functions. Every object of any class has some properties and methods. e.g class MyClass { int i; string j; void MyClass(){}//this is constructor Public void MyMethod( int x )//this is member function { return x*x; } } Now if i make an object of this class MyClass obj = new MyClass();//Notice I called the constructor. Because obj is an instance of MyClass so it must have a cope of i,j and MyMethod(int x) of its own. So what i should do to access these properties(i,j) or member function of MyClass.............Here is wat i would do. obj.i=9;//so i m using dot to access the properties of the object. obj.MyFunction(8);//Here i m calling the member functon. Now to the code u provided. obj.delegateobject = new windowsdelegates.Form2.nameofdelegate(SetText); Look at this in pieces obj is an object of any class this class must have some property delegateobject we are assigning this property(delegateobject) an object of class form2 by setting its name "Set Text". So here is the moral lesson dot is also used to access classes within a namespace. I will recomend u so hav some good book on C#.NET for beginner level. u will get the answers to most of ur questions.

                        N Offline
                        N Offline
                        new2pgrmg
                        wrote on last edited by
                        #11

                        Thankyou Azif :)

                        1 Reply Last reply
                        0
                        Reply
                        • Reply as topic
                        Log in to reply
                        • Oldest to Newest
                        • Newest to Oldest
                        • Most Votes


                        • Login

                        • Don't have an account? Register

                        • Login or register to search.
                        • First post
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • World
                        • Users
                        • Groups