Solved

Translation from VB to C#

Posted on 2011-09-23
6
205 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
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Finally almost got it 5 36
ASP.NET MVC 2 31
Batch file or script with password 22 38
Help with preventing selection from a combobox 9 16
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

19 Experts available now in Live!

Get 1:1 Help Now