Click here to Skip to main content
15,892,005 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to get access to NET2.0 methods in VS2005 Pin
Dave Kreskowiak20-Sep-06 6:18
mveDave Kreskowiak20-Sep-06 6:18 
QuestionData Relation / Databinding Correct With XML visible -sorry Pin
harwanegg20-Sep-06 3:10
harwanegg20-Sep-06 3:10 
QuestionData Relation / Databinding Pin
harwanegg20-Sep-06 3:08
harwanegg20-Sep-06 3:08 
Questionhorizontal scrollbar for ListView component in my WinForm Pin
a#@20-Sep-06 2:47
a#@20-Sep-06 2:47 
QuestionFunction method Pin
Kasic Slobodan20-Sep-06 2:45
Kasic Slobodan20-Sep-06 2:45 
AnswerRe: Function method Pin
User 665820-Sep-06 2:55
User 665820-Sep-06 2:55 
QuestionRe: Function method Pin
Kasic Slobodan20-Sep-06 5:34
Kasic Slobodan20-Sep-06 5:34 
AnswerRe: Function method Pin
S. Senthil Kumar20-Sep-06 5:54
S. Senthil Kumar20-Sep-06 5:54 
The implicit[^] conversion operator does just what you want. Try this piece of code
class VersionInfo
{
    private string majorVersion = "1";
    private string minorVersion = "0";

    public static implicit operator string(VersionInfo versionInfo)
    {
        return versionInfo.majorVersion + "." + versionInfo.minorVersion;
    }

    public string GetMajorInfo()
    {
        return majorVersion;
    }

    public string GetMinorInfo()
    {
        return minorVersion;
    }
}


Make GetVersion return an instance of VersionInfo and you're done.

Regards
Senthil [MVP - Visual C#]
_____________________________
My Blog | My Articles | My Flickr | WinMacro

GeneralRe: Function method Pin
Kasic Slobodan20-Sep-06 6:32
Kasic Slobodan20-Sep-06 6:32 
GeneralRe: Function method Pin
Kasic Slobodan20-Sep-06 6:42
Kasic Slobodan20-Sep-06 6:42 
QuestionExposing C# to COM / Inheritance of objects/interfaces Pin
Adam Clauss20-Sep-06 2:21
Adam Clauss20-Sep-06 2:21 
QuestionTrim textbox Pin
Yustme20-Sep-06 2:14
Yustme20-Sep-06 2:14 
QuestionRe: Trim textbox Pin
Sebastian Schneider20-Sep-06 2:29
Sebastian Schneider20-Sep-06 2:29 
AnswerRe: Trim textbox Pin
Yustme20-Sep-06 2:39
Yustme20-Sep-06 2:39 
GeneralRe: Trim textbox Pin
J4amieC20-Sep-06 2:54
J4amieC20-Sep-06 2:54 
GeneralRe: Trim textbox Pin
Yustme20-Sep-06 3:10
Yustme20-Sep-06 3:10 
GeneralRe: Trim textbox Pin
Sebastian Schneider20-Sep-06 3:21
Sebastian Schneider20-Sep-06 3:21 
GeneralRe: Trim textbox Pin
Yustme20-Sep-06 3:52
Yustme20-Sep-06 3:52 
QuestionMicrosecond timers/delays Pin
sjembek20-Sep-06 2:12
sjembek20-Sep-06 2:12 
AnswerRe: Microsecond timers/delays Pin
S. Senthil Kumar20-Sep-06 6:01
S. Senthil Kumar20-Sep-06 6:01 
GeneralRe: Microsecond timers/delays Pin
sjembek27-Sep-06 1:52
sjembek27-Sep-06 1:52 
QuestionHow to put a clickable button on a PropertyGrid ? Pin
sharongav20-Sep-06 1:35
sharongav20-Sep-06 1:35 
QuestionError On Running Project Of SMS Pin
manishgkumar20-Sep-06 1:27
manishgkumar20-Sep-06 1:27 
QuestionProblem in Combobox Itemdata Pin
M Riaz Bashir20-Sep-06 1:24
M Riaz Bashir20-Sep-06 1:24 
QuestionHow to call Page_Load event from other aspx file.? Pin
irkahc20-Sep-06 1:00
irkahc20-Sep-06 1:00 

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.