473,799 Members | 3,033 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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_Cli ck(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles bAddListbox.Cli ck
Dim lb As New ListBox
lb.Height = 75
lb.Width = 70
lb.Items.Add("l istbox")
tlp.Controls.Ad d(lb)
End Sub

Private Sub bRadiobutton_Cl ick(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles bRadiobutton.Cl ick
Dim iNum As Int64
iNum = InputBox("Enter number of options", "Entry", 4)
Dim rbflp As New FlowLayoutPanel
rbflp.AutoSize = True
rbflp.AutoSizeM ode = Windows.Forms.A utoSizeMode.Gro wAndShrink
rbflp.FlowDirec tion = FlowDirection.L eftToRight
For i As Int16 = 1 To iNum
Dim rbl As New RadioButton
rbl.Text = "option " + CStr(i)
rbflp.Controls. Add(rbl)
Next
tlp.Controls.Ad d(rbflp)

End Sub
--
Nejadian
Feb 5 '08 #1
1 1441
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.mic rosoft.comwrote in message
news:54******** *************** ***********@mic rosoft.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_Cli ck(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles bAddListbox.Cli ck
Dim lb As New ListBox
lb.Height = 75
lb.Width = 70
lb.Items.Add("l istbox")
tlp.Controls.Ad d(lb)
End Sub

Private Sub bRadiobutton_Cl ick(ByVal sender As System.Object, ByVal e
As
System.EventArg s) Handles bRadiobutton.Cl ick
Dim iNum As Int64
iNum = InputBox("Enter number of options", "Entry", 4)
Dim rbflp As New FlowLayoutPanel
rbflp.AutoSize = True
rbflp.AutoSizeM ode = Windows.Forms.A utoSizeMode.Gro wAndShrink
rbflp.FlowDirec tion = FlowDirection.L eftToRight
For i As Int16 = 1 To iNum
Dim rbl As New RadioButton
rbl.Text = "option " + CStr(i)
rbflp.Controls. Add(rbl)
Next
tlp.Controls.Ad d(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
8697
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 field in plain text. That's because I truncate the string text but if, when I truncate it there's a rich tag the code following the truncated string is corrupted. Don't know if it's clear enough.
14
6689
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. :-) Cheers.
1
2205
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 mean,
2
5753
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 Explicit On Option Compare Binary
4
5402
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 "System.Text.Encoding.ASCII.GetString(bytearray)" of .Net library, we found that the char (delimiters) specified above are replaced with different char.
1
1349
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 MSDN site: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wininet/wininet/internetdial.asp Return Values Returns ERROR_SUCCESS if successful, or an error value otherwise. The error code can be one of the following values....
1
6776
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 World" Has anyone ever heard of a function that can do that? Thanks!
18
2662
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 characters. This is ok, unless the character happens to be a '0'. I am certain I am missing something here. Any pointers would be fantastic. Each character in the array is varified individually and a new stringstream string is built using all of...
5
11337
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 loan number. Here's some example data: Loan# Codes 11111 24-13-1 22222 1 33333 2-9
0
9688
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10259
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10030
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7570
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6809
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5467
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4145
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3761
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2941
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.