473,411 Members | 2,185 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,411 software developers and data experts.

Please Convert this function VB.Net to C# .NET

Hi all

Please Convert the VB.Net to C# .NET

Sub CustomPager(ByVal STCPagerGrid As Object)
Dim intCtr As Integer
Static intLastItem As Integer
Static intCount As Integer
Static intTotalPage, lintCurrentPage As Integer

For intCtr = 0 To STCPagerGrid.Controls.Count - 1

If STCPagerGrid.Controls(intCtr).GetType.ToString =
"System.Web.UI.WebControls.DataGridLinkButton" Then
If IsNumeric(STCPagerGrid.controls(intCtr).text) = True
And Left(STCPagerGrid.controls(intCtr).text, 1) <> "[" Then
STCPagerGrid.controls(intCtr).text = "[" &
STCPagerGrid.controls(intCtr).text & "]"
If STCPagerGrid.Controls(intCtr).Text = "..." And intCtr
= 0 Then
STCPagerGrid.Controls(intCtr).Text = "[<<]"
End If
If STCPagerGrid.Controls(intCtr).Text = "..." And intCtr
0 Then

STCPagerGrid.Controls(intCtr).Text = "[>>]"
End If
End If
If STCPagerGrid.controls(intCtr).controls.count > 0 Then
CustomPager(STCPagerGrid.controls(intCtr))
End If
Next
End Sub
Thanks
Venu
Nov 16 '05 #1
4 1526
How many times do you need it converted? I've seen at least three answers
today :-)

Best Regards
Julian N.

----- Original Message -----
From: "Karunakararao" <ka************@i-vantage.com>
Newsgroups: Microsoft.public.dotnet.languages.csharp
Sent: Monday, May 24, 2004 3:55 PM
Subject: Please Convert this function VB.Net to C# .NET

Hi all

Please Convert the VB.Net to C# .NET

<<SSSNNNIIIPPP.........>>
Nov 16 '05 #2
meh
Just stumbled on your reply. Thanks for the link. I am currently trying to
make the transition from VB to VC# and this will allow me to look at
existing VB code to learn the new syntax.........This will be very helpful
to me

thx
meh
"Oren" <an*******@discussions.microsoft.com> wrote in message
news:0F**********************************@microsof t.com...
try: http://developerfusion.com/utilities...btocsharp.aspx

Nov 16 '05 #3
Convert VB and VB.NET to C# tool.
http:\\www.e-iceblue.com
It's may useful to you.
Nov 16 '05 #4
Pick up the free demo at Instant C# (www.instantcsharp.com). It's a
lot easier to get the answer there than to keep posting these
snippets:

//INSTANT C# NOTE: These were formerly VB static local variables:
private static int intLastItem;
private static int intCount;
private static int intTotalPage;
private static int lintCurrentPage;

public void CustomPager(object STCPagerGrid)
{
int intCtr = 0;
//INSTANT C# NOTE: VB local static variable moved to class level
//Static intLastItem As Integer
//INSTANT C# NOTE: VB local static variable moved to class level
//Static intCount As Integer
//INSTANT C# NOTE: VB local static variable moved to class level
//Static intTotalPage, lintCurrentPage As Integer
//INSTANT C# NOTE: VB local static variable moved to class level
//Static lintCurrentPage As Integer

int ForTemp1 = STCPagerGrid.Controls.Count - 1;
//INSTANT C# NOTE: The ending condition of VB 'For' loops is tested
only on entry to the loop. Instant C# has created a temporary
variable in order to use the initial value of
STCPagerGrid.Controls.Count - 1 for every iteration:
for (intCtr = 0; intCtr <= ForTemp1; intCtr++)
{

if (STCPagerGrid.Controls.GetType().ToString() ==)
{
"System.Web.UI.WebControls.DataGridLinkButton" Then;
if
(Microsoft.VisualBasic.Information.IsNumeric(STCPa gerGrid.Controls[intCtr].Text)
== true)
{
//ORIGINAL LINE: And Left(STCPagerGrid.Controls[intCtr].text, 1)
<> "[" Then
& STCPagerGrid.Controls[intCtr].Text.Substring(0, 1) != "[" Then;
STCPagerGrid.Controls[intCtr].Text = "[" +;
STCPagerGrid.Controls[intCtr].Text + "]";
if (STCPagerGrid.Controls[intCtr].Text == "..." & intCtr)
{
= 0 Then;
STCPagerGrid.Controls[intCtr].Text = "[<<]";
}
if (STCPagerGrid.Controls[intCtr].Text == "..." & intCtr)
{
Microsoft.VisualBasic.ControlChars.Quote:
0 Then;
STCPagerGrid.Controls[intCtr].Text = "[>>]";

}
}
if (STCPagerGrid.Controls[intCtr].Controls.Count > 0)
{
CustomPager(STCPagerGrid.Controls[intCtr]);
}
}
}
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #5

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

Similar topics

20
by: da Vinci | last post by:
Hello again. I have a question regaring pass-by-reference and multiple functions. This is an assignment that I have to use pass-by-reference for everything. First off, I made the following...
2
by: Steve | last post by:
I have received a table of data that has a field containing date information. Unfortunately it was derived from a MainFrame dump and originated as a txt file and was then ported into an Access MDB...
5
by: john | last post by:
Here is the short story of what i'm trying to do. I have a 4 sided case labeling printer setting out on one of our production lines. Now then i have a vb.net application that sends data to this...
2
by: Graham Feeley | last post by:
Hi I have data resembling like this Clearing, The Italian Job, The Final Cut, The Manson Family, The I would like some code to convert the data to The Clearing The Italian Job The Final Cut
0
by: Richard Mathis | last post by:
My problem is rather complicated (for me), so I'm going to post my problem here as well as what I've done so far to solve my problem. Any assistance would be appreciated. I originally posted this...
3
by: Tariq Ahmad | last post by:
got this code from codeproject.com, but cant convert it to vb. can u help please? thnx. t. ---------------------------------------------------------------------------- ------- Append a...
1
by: Mark Hollander | last post by:
Hi All, Could you please help me convert this code so that it will run in VB.NET Thank You Mark Hollander Private Type USER_INFO Name As String
10
by: | last post by:
Hi I have trying to solve this but I can't understand why it's not working. I want to cast a variable dynamically with a type that I pass truogh a string. I am receiving a value and want to...
4
by: =?Utf-8?B?Q2hhcmxlcw==?= | last post by:
Hello all, I'm trying to convert a Java Genetic Programming program to C#. I don't know how to convert the following Java code: Object choice = functionSet.getSelectedItem(choice)).value();...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
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...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...

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.