convert following code in vb.net

N

NetPointer

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;
}
}
 
H

Herfried K. Wagner [MVP]

* "NetPointer said:
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>
 
A

Armin Zingler

NetPointer said:
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
 
S

steve

| 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
 
S

steve

| Return MyBase.CreateParams Or ES_NUMBER

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

steve
 
S

steve

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

| 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>
 
S

steve

| Return MyBase.CreateParams Or ES_NUMBER

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

steve


| * "NetPointer" <[email protected]> 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>
 
S

steve

| Return MyBase.CreateParams Or ES_NUMBER

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

steve
 
S

steve

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
 
S

steve

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


| Hi Steve,
|
| Which guns would those be?
|
| Regards,
| Fergus
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top