Solved

Translation from VB to C#

Posted on 2011-09-23
6
206 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 7

Expert Comment

by:Bill Nolan
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:
Bill Nolan 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 7

Expert Comment

by:Bill Nolan
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How do I hide MVVM menu items in WPF/XAML? 1 36
Please explain purpose of GZIP 4 59
Groupbox Control ? 2 27
How to escape alias names for Oracle query 1 25
More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

749 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