|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
The free format?I have tried, most for fun, to write a property on ONE line. I have not succeded. Can you? <Bindable(False), _ Description("Sets the CSS class of the button."), _ Category("CssClasses"), _ DefaultValue("")> _ Public Property CssClassButton() As String Get Return _CssClassButton End Get Set(ByVal Value As String) _CssClassButton = Value End Set End Property "kurt sune" <a**@apa.com> schrieb What is "free format"?> VB is supposed to have free format. > I have tried, most for fun, to write a property on ONE line. This is not possible.Show quoteHide quote > I have not succeded. See also:> > Can you? > > <Bindable(False), _ > > Description("Sets the CSS class of the button."), _ > > Category("CssClasses"), _ > > DefaultValue("")> _ > > Public Property CssClassButton() As String > > Get > > Return _CssClassButton > > End Get > > Set(ByVal Value As String) > > _CssClassButton = Value > > End Set > > End Property http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec12.asp Armin kurt sune wrote:
> VB is supposed to have free format. No it isn't, at least VB.NET isn't. There are plenty of places where anewline is syntactically necessary. In general, the Basic family of languages has always been line-oriented. The C family of languages has generally been character-oriented, and I believe C# retains this: you can write perfectly acceptable C# programs on one line, if you want. You would hate Python. -- Larry Lard Replies to group please What about telling us the error you see ? You may have a problem in the
surrounding code. Works here... -- Show quoteHide quotePatrice "kurt sune" <a**@apa.com> a écrit dans le message de news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl... > VB is supposed to have free format. > > I have tried, most for fun, to write a property on ONE line. > > I have not succeded. > > Can you? > > <Bindable(False), _ > > Description("Sets the CSS class of the button."), _ > > Category("CssClasses"), _ > > DefaultValue("")> _ > > Public Property CssClassButton() As String > > Get > > Return _CssClassButton > > End Get > > Set(ByVal Value As String) > > _CssClassButton = Value > > End Set > > End Property > > This code:
Public Overrides Property CssClass() As String : Get End Get Set(ByVal Value As String) End Set End Property returns this error: "Method declaration statements must be the first statement on a logical line" /k Show quoteHide quote "Patrice" <a@bc.c> wrote in message news:Ot7BJfCHGHA.1396@TK2MSFTNGP11.phx.gbl... > What about telling us the error you see ? You may have a problem in the > surrounding code. Works here... > > -- > Patrice > > "kurt sune" <a**@apa.com> a écrit dans le message de > news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl... > > VB is supposed to have free format. > > > > I have tried, most for fun, to write a property on ONE line. > > > > I have not succeded. > > > > Can you? > > > > <Bindable(False), _ > > > > Description("Sets the CSS class of the button."), _ > > > > Category("CssClasses"), _ > > > > DefaultValue("")> _ > > > > Public Property CssClassButton() As String > > > > Get > > > > Return _CssClassButton > > > > End Get > > > > Set(ByVal Value As String) > > > > _CssClassButton = Value > > > > End Set > > > > End Property > > > > > > IMO, expected for this one : is the separator for *executable* statements.
I'm not really suprised it doesn't work in a declaration statement. -- Show quoteHide quotePatrice "kurt sune" <a**@apa.com> a écrit dans le message de news:Ox2V7vMHGHA.3120@TK2MSFTNGP10.phx.gbl... > This code: > Public Overrides Property CssClass() As String : Get > > End Get > > Set(ByVal Value As String) > > End Set > > End Property > > > > returns this error: "Method declaration statements must be the first > statement on a logical line" > > > > /k > > > > "Patrice" <a@bc.c> wrote in message > news:Ot7BJfCHGHA.1396@TK2MSFTNGP11.phx.gbl... > > What about telling us the error you see ? You may have a problem in the > > surrounding code. Works here... > > > > -- > > Patrice > > > > "kurt sune" <a**@apa.com> a écrit dans le message de > > news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl... > > > VB is supposed to have free format. > > > > > > I have tried, most for fun, to write a property on ONE line. > > > > > > I have not succeded. > > > > > > Can you? > > > > > > <Bindable(False), _ > > > > > > Description("Sets the CSS class of the button."), _ > > > > > > Category("CssClasses"), _ > > > > > > DefaultValue("")> _ > > > > > > Public Property CssClassButton() As String > > > > > > Get > > > > > > Return _CssClassButton > > > > > > End Get > > > > > > Set(ByVal Value As String) > > > > > > _CssClassButton = Value > > > > > > End Set > > > > > > End Property > > > > > > > > > > > >
Show quote
Hide quote
"kurt sune" <a**@apa.com> schrieb im Newsbeitrag Maybe you overlooked the link I gave in my previous post because It was at news:Ox2V7vMHGHA.3120@TK2MSFTNGP10.phx.gbl... > This code: > Public Overrides Property CssClass() As String : Get > > End Get > > Set(ByVal Value As String) > > End Set > > End Property > > > > returns this error: "Method declaration statements must be the first > statement on a logical line" the bottom: http://msdn.microsoft.com/library/en-us/vbls7/html/vblrfVBSpec12.asp Armin Hi,
That should work. You will need imports system.componentmodel at the top of the file for the attributes to work. Ken ---------------------- Show quoteHide quote "kurt sune" <a**@apa.com> wrote in message news:OLD3CSCHGHA.3916@TK2MSFTNGP10.phx.gbl... > VB is supposed to have free format. > > I have tried, most for fun, to write a property on ONE line. > > I have not succeded. > > Can you? > > <Bindable(False), _ > > Description("Sets the CSS class of the button."), _ > > Category("CssClasses"), _ > > DefaultValue("")> _ > > Public Property CssClassButton() As String > > Get > > Return _CssClassButton > > End Get > > Set(ByVal Value As String) > > _CssClassButton = Value > > End Set > > End Property > >
MsgBox("test") no msg box?
How do I schedule events for execution ? How to check datatable.select Type 'OleDbConnection' no define Getting the hWnd of an IE window from an NT service Variable that holds the record count of a result set? Question on Dataset navigation vb.net Generate all possible maches from a regular expression. Using control array run time with different control names How to know if Windows firewall is on or off? |
|||||||||||||||||||||||