By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,654 Members | 1,582 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,654 IT Pros & Developers. It's quick & easy.

convert following code in vb.net

P: n/a
How to convert following in to VB.NET ??? specifically the
constant...es_number.

const int ES_NUMBER = 0x2000;
protected override System.Windows.Forms.CreateParams CreateParams
{
get
{
System.Windows.Forms.CreateParams cp = base.CreateParams;
cp.Style |= ES_NUMBER;
return cp;
}
}
Nov 20 '05 #1
Share this Question
Share on Google+
16 Replies


P: n/a
* "NetPointer" <sh**************@intel.com> scripsit:
How to convert following in to VB.NET ??? specifically the
constant...es_number.

const int ES_NUMBER = 0x2000;
protected override System.Windows.Forms.CreateParams CreateParams
{
get
{
System.Windows.Forms.CreateParams cp = base.CreateParams;
cp.Style |= ES_NUMBER;
return cp;
}
}


\\\
Protected Const ES_NUMBER As Integer = 2000

Protected Overrides ReadOnly Property CreateParams() As CreateParams
Get
Return MyBase.CreateParams Or ES_NUMBER
End Get
End Property
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #2

P: n/a
| const int ES_NUMBER = 0x2000;
| protected override System.Windows.Forms.CreateParams CreateParams
| {
| get
| {
| System.Windows.Forms.CreateParams cp = base.CreateParams;
| cp.Style |= ES_NUMBER;
| return cp;
| }
| }

const ES_NUMBER as integer = &H2000

protected overrides readonly property CreateParams()
get
dim params as CreateParams = mybase.CreateParams
params.style = params.style or ES_NUMBER ' can't short-hand or=
return params
end property

hth,

steve
Nov 20 '05 #3

P: n/a
Errata:
const int ES_NUMBER = 0x2000;
[...] Protected Const ES_NUMBER As Integer = 2000


The line above should read:

\\\
Protected Const ES_NUMBER As Integer = &H2000
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #4

P: n/a
| Return MyBase.CreateParams Or ES_NUMBER

wrong! he's not or-ing the createparams object but its member cp.style.

steve
Nov 20 '05 #5

P: n/a
"NetPointer" <sh**************@intel.com> schrieb
How to convert following in to VB.NET ??? specifically the
constant...es_number.

const int ES_NUMBER = 0x2000;
protected override System.Windows.Forms.CreateParams CreateParams
{
get
{
System.Windows.Forms.CreateParams cp = base.CreateParams;
cp.Style |= ES_NUMBER;
return cp;
}
}


Private Const ES_NUMBER As Integer = &H2000

Protected Overrides ReadOnly Property CreateParams() _
As System.Windows.Forms.CreateParams
Get
Dim cp As System.Windows.Forms.CreateParams
cp = MyBase.CreateParams
cp.Style = cp.Style Or ES_NUMBER
Return cp
End Get
End Property

--
Armin

http://learn.to/quote
http://www.plig.net/nnq/nquote.html

Nov 20 '05 #6

P: n/a
i was going to check that on you too...you beat me to it ;^)

btw, 8192 = 0x2000 so you could have just changed the value to that instead
of &h2000...but that's trival.

;^)

steve

"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bn*************@ID-208219.news.uni-berlin.de...
| Errata:
|
| >> const int ES_NUMBER = 0x2000;
| [...]
| > Protected Const ES_NUMBER As Integer = 2000
|
| The line above should read:
|
| \\\
| Protected Const ES_NUMBER As Integer = &H2000
| ///
|
| --
| Herfried K. Wagner
| MVP VB Classic, VB.NET
| <http://www.mvps.org/dotnet>
|
| Improve your quoting style:
| <http://learn.to/quote>
| <http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #7

P: n/a
| Return MyBase.CreateParams Or ES_NUMBER

wrong! he's not or-ing the createparams object but its member cp.style.

steve
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bn*************@ID-208219.news.uni-berlin.de...
| * "NetPointer" <sh**************@intel.com> scripsit:
| > How to convert following in to VB.NET ??? specifically the
| > constant...es_number.
| >
| > const int ES_NUMBER = 0x2000;
| > protected override System.Windows.Forms.CreateParams CreateParams
| > {
| > get
| > {
| > System.Windows.Forms.CreateParams cp = base.CreateParams;
| > cp.Style |= ES_NUMBER;
| > return cp;
| > }
| > }
|
| \\\
| Protected Const ES_NUMBER As Integer = 2000
|
| Protected Overrides ReadOnly Property CreateParams() As CreateParams
| Get
| Return MyBase.CreateParams Or ES_NUMBER
| End Get
| End Property
| ///
|
| --
| Herfried K. Wagner
| MVP VB Classic, VB.NET
| <http://www.mvps.org/dotnet>
|
| Improve your quoting style:
| <http://learn.to/quote>
| <http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #8

P: n/a
Thanks Steve and Herfried,

I was missing that OR....

Thanks a lot.

Regards,
"steve" <as*@abc.com> wrote in message
news:vq************@corp.supernews.com...
| const int ES_NUMBER = 0x2000;
| protected override System.Windows.Forms.CreateParams CreateParams
| {
| get
| {
| System.Windows.Forms.CreateParams cp = base.CreateParams;
| cp.Style |= ES_NUMBER;
| return cp;
| }
| }

const ES_NUMBER as integer = &H2000

protected overrides readonly property CreateParams()
get
dim params as CreateParams = mybase.CreateParams
params.style = params.style or ES_NUMBER ' can't short-hand or=
return params
end property

hth,

steve

Nov 20 '05 #9

P: n/a
| Return MyBase.CreateParams Or ES_NUMBER

wrong! he's not or-ing the createparams object but its interface cp.style.

steve
Nov 20 '05 #10

P: n/a
"NetPointer" <sh**************@intel.com> schrieb
Thanks Steve and Herfried,


and me?? ;-)
Armin

Nov 20 '05 #11

P: n/a
Thanks 2 u 2 Armin.. :)

Cheers. :-)
"Armin Zingler" <az*******@freenet.de> wrote in message
news:en**************@TK2MSFTNGP12.phx.gbl...
"NetPointer" <sh**************@intel.com> schrieb
Thanks Steve and Herfried,


and me?? ;-)
Armin

Nov 20 '05 #12

P: n/a
* "steve" <as*@abc.com> scripsit:
| Return MyBase.CreateParams Or ES_NUMBER

wrong! he's not or-ing the createparams object but its interface cp.style.


I know, I should take more sleep.

\\\
Return MyBase.CreateParams.Style Or ES_NUMBER
///

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

Improve your quoting style:
<http://learn.to/quote>
<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #13

P: n/a
i know how you feel ;^)
| \\\
| Return MyBase.CreateParams.Style Or ES_NUMBER
| ///
returns the style interface and not the modified version of the createparams
object in total. ;^)

but i need sleep too.

btw, keep sticking to your guns herf. (in reference to all other ot
non-sense)

catch you later (no pun intended ;^)
steve
Nov 20 '05 #14

P: n/a
Hi Steve,

Which guns would those be?

Regards,
Fergus
Nov 20 '05 #15

P: n/a
you have to give the guy credit for not changing or swaying from what he
believes is true. that's a part of integrity. the negative consequences of
not flexing are relative to the observer based on what is being expressed.
anyway, i admire that and thought i'd compliment and encourge him.

btw, the statement applies to the tons of ot posts in which he's
participated and not to the particpants who responded. i don't necissarily
agree with anything he or anyone else said in the posts...just that he has
stood his ground.

not casting dispursions anywhere or on anyone. ;^)

post you later,

steve
"Fergus Cooney" <fi*****@post.com> wrote in message
news:OB*************@TK2MSFTNGP11.phx.gbl...
| Hi Steve,
|
| Which guns would those be?
|
| Regards,
| Fergus
|
|
Nov 20 '05 #16

P: n/a
Hi Steve,

There's a reply in ms.pub.nntp.test, if you want.

Regards,
Fergus
Nov 20 '05 #17

This discussion thread is closed

Replies have been disabled for this discussion.