Translation from VB to C#

Dear Experts,

I have found a code for resize a borderless form:
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

Who is Participating?
Bill NolanConnect With a Mentor Owner, Lead Technology ProgrammerCommented:
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.
Bill NolanOwner, Lead Technology ProgrammerCommented:
What is the problem you get?
peterkiersAuthor Commented:
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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Bill NolanOwner, Lead Technology ProgrammerCommented:
It sounds like a problem with your mouse up/down events, and not this switch statement.
peterkiersAuthor Commented:
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?

peterkiersAuthor Commented:
With my last post I start a new question.


Peter Kiers
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.