473,799 Members | 3,061 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Please convert to VB.NET

Please convert to VB.NET

protected override bool ProcessKeyEvent Args(ref Message m)
{

if((char)m.WPar am == '.')

m.WParam = (IntPtr)',';

return false;

}

Thanks!
Buzz
Aug 19 '05 #1
10 2506
Our Instant VB C# to VB converter produces the following (download the demo
edition at www.instantvb.com)

Protected Overrides Function ProcessKeyEvent Args(ByRef m As Message) As
Boolean

If CChar(m.WParam) = "."c Then
m.WParam = CType(","c, IntPtr)
End If

Return False

End Function

--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#
"Buzz" wrote:
Please convert to VB.NET

protected override bool ProcessKeyEvent Args(ref Message m)
{

if((char)m.WPar am == '.')

m.WParam = (IntPtr)',';

return false;

}

Thanks!
Buzz

Aug 20 '05 #2
Hi Buzz,

Please try the following VB.NET code.

Protected Overrides Function ProcessKeyEvent Args(ByRef m As Message) As
Boolean
If Convert.ToChar( m.WParam.ToInt3 2()) = "."c Then
m.WParam = New IntPtr(Convert. ToInt32(","c))
Return False
End If
End Function

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Aug 20 '05 #3
David,

Which is in my opinion very nice real VB.Net code

:-)

Cor
Aug 20 '05 #4
By the way, if this isn't just an adhoc sample, you might want to review what
it's supposed to do - it always returns false for instance. Also, there's no
need for the parameter to be 'ref'.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#
"Buzz" wrote:
Please convert to VB.NET

protected override bool ProcessKeyEvent Args(ref Message m)
{

if((char)m.WPar am == '.')

m.WParam = (IntPtr)',';

return false;

}

Thanks!
Buzz

Aug 20 '05 #5
Hi David,

Kevin Yu's VB.NET example worked. I was unable to get your example working.

Thanks,
Buzz

"David Anton" wrote:
By the way, if this isn't just an adhoc sample, you might want to review what
it's supposed to do - it always returns false for instance. Also, there's no
need for the parameter to be 'ref'.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#
"Buzz" wrote:
Please convert to VB.NET

protected override bool ProcessKeyEvent Args(ref Message m)
{

if((char)m.WPar am == '.')

m.WParam = (IntPtr)',';

return false;

}

Thanks!
Buzz

Aug 22 '05 #6
Buzz,
Kevin Yu's VB.NET example worked. I was unable to get your example
working.


I can oversee something however looking at David's code is it the same as
from Kevin (who uses only the basic framework), while in Buzz code are some
more optimized VBNet methods used.

Probably I oversee something however when not than it can be interesting and
therefore: Can you give us the error you got with Buzz his code?

Cor
Aug 22 '05 #7
If CChar(m.WParam) = "." Then 'Value of type 'System.IntPtr' cannot be
converted to 'Char'.
m.WParam = CType(",", IntPtr) 'Value of type 'String' cannot be
converted to 'System.IntPtr' .
End If
"Cor Ligthert [MVP]" wrote:
Buzz,
Kevin Yu's VB.NET example worked. I was unable to get your example
working.


I can oversee something however looking at David's code is it the same as
from Kevin (who uses only the basic framework), while in Buzz code are some
more optimized VBNet methods used.

Probably I oversee something however when not than it can be interesting and
therefore: Can you give us the error you got with Buzz his code?

Cor

Aug 22 '05 #8
Thanks for the bug report Buzz. We're looking into it now - it appears that
the intrinsic VB cast methods do not cut it (compared to C# casting) in many
cases.
Within the next day we'll have a new build that results in conversions
making more use of the Convert class methods.
--
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#
"Buzz" wrote:
If CChar(m.WParam) = "." Then 'Value of type 'System.IntPtr' cannot be
converted to 'Char'.
m.WParam = CType(",", IntPtr) 'Value of type 'String' cannot be
converted to 'System.IntPtr' .
End If
"Cor Ligthert [MVP]" wrote:
Buzz,
Kevin Yu's VB.NET example worked. I was unable to get your example
working.


I can oversee something however looking at David's code is it the same as
from Kevin (who uses only the basic framework), while in Buzz code are some
more optimized VBNet methods used.

Probably I oversee something however when not than it can be interesting and
therefore: Can you give us the error you got with Buzz his code?

Cor

Aug 22 '05 #9
Buzz,

Thanks for showing it.

It would be in the shortest code

ChrW(m.WParam.T oInt32)
and
New IntPtr(Asc(",") )

Before you misunderstand me, there is nothing wrong with the code from
Kevin. I have now learned again from this.

Thanks

Cor
Aug 22 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1110
by: JoseTA | last post by:
Anybody Could please help this... MDIParent Form: ------------------- Event ButtonClick(strKey As String) Private Sub tbrMain_ButtonClick(ByVal Button _ As MSComctlLib.Button) RaiseEvent ButtonClick(Button.Key) End Sub
4
1548
by: Karunakararao | last post by:
Hi all Please Convert the VB.Net to C# .NET Sub CustomPager(ByVal STCPagerGrid As Object) Dim intCtr As Integer Static intLastItem As Integer Static intCount As Integer Static intTotalPage, lintCurrentPage As Integer
10
295
by: Buzz | last post by:
Please convert to VB.NET protected override bool ProcessKeyEventArgs(ref Message m) { if((char)m.WParam == '.') m.WParam = (IntPtr)','; return false;
3
7004
by: Todd_Goselin | last post by:
Hello, I've got a problem that I can't fix by myself, I'm fairly new to programming in C and in Unix and so I'm having a tough time doing a simple task of converting a binary number to a string. Can anyone help me with that? Here is the problem: vals2 = ldap_get_values(ld,e,b);
1
5605
by: shovan mohanty | last post by:
Hi , Can anybody convert below access query into equivalent stored procedure. Also please advice in the below query,user defined function of VBA i.e anneeSelection41510() has been used in the .MDB file(access project).Now how this can be implemented in the equivalent .ADP(client/server architechture)project because obviously anneeSelection41510() function will not be recognised by the sql server." (t_activity_month.fy)=anneeSelection41510())...
2
1894
by: rahuldev999 | last post by:
Hi Can anyone please convert the below access query to the equivalent stored procedure.No problem with the IIF() function but the condition in the "where" clause making problem.so please put some light on the that part. Also how to implement it in the VBA code. SELECT t_activity.no_activity, IIf(="GP","Plan", IIf(="Prov","Appr.",IIf(="Fix","Fix", ))) AS act_steps FROM t_activity_brand, t_customer INNER JOIN t_activity ON ...
2
3396
by: royjm18 | last post by:
Dim MyMoney As Single Dim DRolls As Integer Dim NRolls As Integer Dim PRolls As Integer Dim QRolls As Integer Dim RemainingChange As Single MyMoney = 28.24 QRolls = Int(MyMoney / 10) MyMoney = MyMoney - QRolls * 10
0
89560
by: phani kumar NSR | last post by:
i have a query which is in oracle pls convert and give me in postgresql format. SELECT MST.TW_TRAN_NO ,NVL(DEPT_RCPT_NO,'--'),CONSUMER_NO,NVL(CONSUMER_NAME,'---'), UPPER( DECODE (PAY_MODE,'C','Cash','D','DD','CD','CASH/DD','Q','Chq','R','Card')), TOT_AMT,DEPT_SHORT_DESC,TRAN_STATUS,NVL(USER_CHARGES,0),shift_code, NVL(DECODE(PAY_MODE,'R',(NVL(CHQDD_CARD_AMT,0)-NVL(TOT_AMT,0)- NVL(USER_CHARGES,0))),0) ...
0
9546
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10491
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10268
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9079
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7571
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4146
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3762
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.