473,320 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

converting VB codes to C#

Hi, Could someone please et me know how I can convert the below codes from
Visual Basic to C# using Visual studio. When each button clicked they create
list box and Radio Button. I want to convert those codes into C# doing same
action. The codes are:
Private Sub bAddListbox_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bAddListbox.Click
Dim lb As New ListBox
lb.Height = 75
lb.Width = 70
lb.Items.Add("listbox")
tlp.Controls.Add(lb)
End Sub

Private Sub bRadiobutton_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bRadiobutton.Click
Dim iNum As Int64
iNum = InputBox("Enter number of options", "Entry", 4)
Dim rbflp As New FlowLayoutPanel
rbflp.AutoSize = True
rbflp.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
rbflp.FlowDirection = FlowDirection.LeftToRight
For i As Int16 = 1 To iNum
Dim rbl As New RadioButton
rbl.Text = "option " + CStr(i)
rbflp.Controls.Add(rbl)
Next
tlp.Controls.Add(rbflp)

End Sub
--
Nejadian
Feb 5 '08 #1
1 1415
Visual Studio doesn't do language conversions.

There are many 3rd party tools/utilities that will.

http://www.google.com/search?q=vb.ne...x=&startPage=1

-Scott

"Tammy Nejadian" <Ta***********@discussions.microsoft.comwrote in message
news:54**********************************@microsof t.com...
Hi, Could someone please et me know how I can convert the below codes from
Visual Basic to C# using Visual studio. When each button clicked they
create
list box and Radio Button. I want to convert those codes into C# doing
same
action. The codes are:
Private Sub bAddListbox_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles bAddListbox.Click
Dim lb As New ListBox
lb.Height = 75
lb.Width = 70
lb.Items.Add("listbox")
tlp.Controls.Add(lb)
End Sub

Private Sub bRadiobutton_Click(ByVal sender As System.Object, ByVal e
As
System.EventArgs) Handles bRadiobutton.Click
Dim iNum As Int64
iNum = InputBox("Enter number of options", "Entry", 4)
Dim rbflp As New FlowLayoutPanel
rbflp.AutoSize = True
rbflp.AutoSizeMode = Windows.Forms.AutoSizeMode.GrowAndShrink
rbflp.FlowDirection = FlowDirection.LeftToRight
For i As Int16 = 1 To iNum
Dim rbl As New RadioButton
rbl.Text = "option " + CStr(i)
rbflp.Controls.Add(rbl)
Next
tlp.Controls.Add(rbflp)

End Sub
--
Nejadian

Feb 5 '08 #2

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

Similar topics

3
by: Alfredo Agosti | last post by:
Hi folks, I have an Access 2000 db with a memo field. Into the memo field I put text with bold attributes, URL etc etc What I need to to is converting the rich text contained into the memo...
14
by: Toronto Web Designer | last post by:
Heya, I'm curious to know if there are any programs that convert HTML tables to a CSS layout. I already have a good handle on CSS but I'm always on the lookout for other ways of doing things. ...
1
by: atif | last post by:
Hi All Can we convert Windows Forms into Web Forms and/or vise versa? I have heard that this is possible through some third party tool, i m not sure. if yes then how much it will cost, i...
2
by: Asbjørn Ulsberg | last post by:
Hi. I'm trying to convert Brady Hegberg's great RTF2HTML VB 6.0 module to C#. I've managed to convert the VB code to VB.NET, which gave me the following code: Option Strict On Option...
4
by: Prabhu | last post by:
Hi, We are having problem in converting a byte array to string, The byte array has char(174), char(175), char(240), char(242) and char(247) as delimiters for the message. when we use...
1
by: Lars Netzel | last post by:
I need to use a few WIN API functions and get Return values as Long and Integers from those.. how do I convert these to the error codes so I get to know what error I really got? Example from...
1
by: Jimbo | last post by:
Basically I'm looking for a function that will parse a string and replace any entity codes it finds w/ the actual character. For instance the function would convert "Hello&nbsp;World" into "Hello...
18
by: Daz | last post by:
Hi all! I know this sounds like a stupid question, but I need to varify whether ot not a single char (from a char array) is a number. I have tried using atoi, but it seems to return '0' for any...
5
by: Patti | last post by:
I am struggling with converting a certain varchar column into an int. I have a table that has 2 fields - one field holds the loan number and the other field holds the codes associated with that...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.