Solved

Translation from VB to C#

Posted on 2011-09-23
6
204 Views
Last Modified: 2013-12-17
Dear Experts,

I have found a code for resize a borderless form:
http://www.vbforums.com/showthread.php?t=568015
And in VB it works great. But after converting it to C# I
get a little problem that I can fix on my own. So I am
trying to figure out where the problem lies by comparing
each methode And then hope to get lucky.

So I have put in the textfile a methode in VB and the same
in C#. My question: I see in C# that a keyword Break is used
by each step and I see nothing in VB. Is this normal?

Greetings, Peter Kiers

Example.txt
0
Comment
Question by:peterkiers
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:Slimfinger
ID: 36585621
What is the problem you get?
0
 
LVL 1

Author Comment

by:peterkiers
ID: 36585658
Its just a little problem:

What the VB-code does:
When a user goes with his cursor to the edge of the borderless form, a two-way
arrow appears. The user then presses the left-mouse button so he can change
the size of the borderless form. When he releases the left-mouse button the
edge of the form releases the cursor. But in C# it doesn't. I have to click again
to release the edge of the form.

I hope I have explaint it well

Peter
0
 
LVL 7

Accepted Solution

by:
Slimfinger earned 500 total points
ID: 36585659
I don't use VB much; I do not think there is a corollary to the 'break' command in VB's "select case" (it seems to be implicit).

'Break' simply exits the switch statement in C#, C, C++.  In the example you provided here there is no logical difference.
0
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 7

Expert Comment

by:Slimfinger
ID: 36585664
It sounds like a problem with your mouse up/down events, and not this switch statement.
0
 
LVL 1

Author Comment

by:peterkiers
ID: 36585677
I have added the whole code of the VB example and the converted to C#
in a textfile.

I really hope someone can help me?

Peter
C.txt
VB.txt
0
 
LVL 1

Author Comment

by:peterkiers
ID: 36585821
With my last post I start a new question.

Greetings,

Peter Kiers
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now