Translate Code Snippet From C#
Sep 29, 2011I need to translate line 4 in the code snippet below into VB. For some reason I cannot get this done tonight. I am either too tired or having a brain drain.[code]
View 5 RepliesI need to translate line 4 in the code snippet below into VB. For some reason I cannot get this done tonight. I am either too tired or having a brain drain.[code]
View 5 RepliesI am looking at this blog, and I am trying to translate the snippet to VB.
I'm having difficulties with this line:
NotifyCollectionChangedEventHandler handlers = this.CollectionChanged;
NOTE: CollectionChanged is an event of this ('this' is an override of ObservableCollection<T>).
How do I add a comment to code snippet in Visual Studio?
View 18 RepliesI have tried a number of freely available code converters to convert the following piece, however without success.
Dim resultList = ((From e In p_Xml.Elements()
Where UCase(e.Name.LocalName) = searchName).Union(
From a In p_Xml.Attributes()
Where UCase(a.Name.LocalName) = searchName
Select <<%= propertyName %>><%= a.Value %></>)).ToList()
I think I got it here
var resultList = (from e in p_xml.Elements()
where e.Name.LocalName == searchName
select propertyName).
[code]....
I have problems in converting the following code-snippet from C# to VB.Net:
if ((currentItem.Tag as FileSystemKind?) != FileSystemKind.File)
{
if (currentFileName == GOBACK)
[code]......
As I read [URL] For VB: Inside the Snippet element, add the References element and all of the required child elements that add a reference to the project when the snippet is inserted.For C# Visual C# code snippets to do not support the References section, so a reference to System.Windows.Forms.dll must be added to the project manually What fundamental reason prevents C# to support References like VB ?[URL] But it isn't even as full-featured as Code Snippet References as Code Snippet References will allow you to add multiple references at once not just one by one.C# is supposedly more "professional" than VB.NET, one would expect C# to be more featured not more limited or does "professional" means you have to do it the hard way as said "MANUALLY"?
View 3 RepliesThis is a part of my project, my project basically uses a motion sensor to detect any intrusion. So one of the modules is to lock the PC on detection of an intruder. Is there a way to lock the PC using Visual Basic?(Because most of the other modules have been programmed in Visual Basic.) I am basically looking for source code that can implement something similar to "Windows button + L".
View 1 RepliesI want this code in VB.NET I can't convert it...
Code1
Response.Redirect("user.aspx?val=" + txtBox.Text);
string strVal = Request.QueryString["val"];
[code].....
Visual Studio 2005.I was converting some of my source code to C#.However, when I was doing the code snippet below, I noticed I don't have the IsNumber method.Why is the IsNumber missing? I wanted to use it so that I can force a user to enter only numbers.
Private Sub TextBox1_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
If e.KeyChar.IsNumber(e.KeyChar) = False Then
[code]....
i am trying to port one of my old vb6 applications to vb 2008 Having trouble coverting this
Call cNavAndWait.navigateAndWait(WebBrowser1, "http://www.mysite.com")
Set HTML = WebBrowser1.Document
For Each HyperLink In HTML.links
[code]....
The associated html code im trying to click looks like this...
<a onclick="document.location.href = '../blah.php' + document.location.search; return false;" href="../files/blah.jpg">Click Here!</a>
All the automated, online converters weren't able to convert this code. Unfortunately my brief knowledge of C# has also let me down. The code originates from a blog, linked from another of my questions.
[Code]...
i've tried all the online code converters but none of them work on this. explain to me how to transform this sniped it to vb.net?
[Code]...
I am having a hard time converting this snippet to VB.NET
Function DecryptPassword(ByVal s As String) As String
Dim i As Integer
Dim sPass As String = s.Trim()
[code]....
It works well in VB6 but throws error when i VB.Net..
I am working on a little small 10 question quiz. The quiz is just for fun for a work thing I'm doing. I'm using VB.net. I'd like to put in one of the questions something like "what's your favorite baseball team?" Then list 3 radio buttons for 3 possible answers. But I'd like to make 2 of the radio buttons move away when a person tries to mouse over it to click on it. So only the answer I want them to use would be possible. I can creat it all but the code to make the raido buttons move when moused over. I've been searching but having trouble finding anything on how to do this.
I don't have my actual quiz code in front of me. But can post the form code for that question later tonight when I get home if needed. But the form is very basic. just has the question in a lable, Then the 3 answers below it as radio buttons. I have a next button that goes to the next form and closes the previous one, and an exit button that closes down the whole application.
I'm wondering, what is a Code Snippet?
View 1 RepliesI am looking for an easy way to have a command prompt like interface for my form. The idea is to make it an interactive text interface. Here is an example of what it might look like > Hi Hello! > How are you? I am fine! >_So it's very much like a chat. BTW, I am not referring to what the example is, just the concept of a command prompt, that I can create a scrollback buffer for. Very much like a MSDOS prompt.
View 5 Repliestranslate this c# code to vb.net , the online convertion tools dont seem to do a good job and my c# knowledge is not good enough. the main problem i have is how to write the code that is after "(new claimsRequest......"
protected void OpenIdAjaxTextBox1_LoggingIn(object sender, OpenIdEventArgs e) {
// Retrieve the email address of the user
e.Request.AddExtension(new ClaimsRequest {
[code]....
Working through Pro ASP.NET MVC book and I got the following code snippet that appears in an aspx (view) page.
<%= Html.DropDownList ("WillAttend",new[]
{
new SelectListItem { Text = "Yes, I'll be there",Value=bool.TrueString},
new SelectListItem { Text = "No, I can't come",Value=bool.FalseString}
},"Choose an option"); %>
[Code]...
I have found the following code which can get the harddisk no in VB6.0.I would like to translate it into vb.net code.I have tried the auto upgrade function in vb2005 and translated the following code to vb.net, but the outcome did not run probably.Can anyone give me some help to translate the following VB6.0 code into vb.net code?
[Code]...
I need a hand with something i need to translate the following code to VB...
[Code]...
im having some difficutly with syntax etc.
public void Attach()
{
deviceHandle = capCreateCaptureWindow(string.Empty, WS_VISIBLE | WS_CHILD, 0, 0, (int)this.ActualWidth -150, (int)this.ActualHeight, new WindowInteropHelper(this).Handle, 0);
if (SendMessage(deviceHandle, WM_CAP_DRIVER_CONNECT, (IntPtr)0, (IntPtr)0).ToInt32() > 0)
[code]....
I'm trying to create an interface that automatically implements a fully typed out method in VB.Net
However, I can't figure out how to do it.
I wanna do something that's similar to what happens when you implement IDisposable, where it gives you the full function, including codes and comments.
I know how to make a code snippet and how to use the tab shortcut, but how can I make the code snippet automatically appear when I implement my own interface?
I've recently decided to take a huge leap and migrate from my good old VB 6.0 to VB.NET, since VB 6.0 was proved to be fairly insufficient for my needs. So, I took a deep breath, loaded myself with a lot of patience and...here I am!The transition from VB 6.0 code to VB.NET seemed quite buffling in the beginning, but later on it proved to be pretty straightforward.So, now, I've decided to get my feet wet and develope my first VB.NET appication.The reason I'm here is that I would like an evaluation of my first code snippet in terms of efficiency, productivity and so on.
A description of what I'm doing is this: On a Windows form, docked at the left side, I have a panel set to AutoScroll. Inside it I've placed a number of panels, each one with a ToolStrip, having a button to collapse or expand the panel.It works so far, but I don't know how efficient my code is. Here is the code of a generic Click Event that handles the clicks of all toolstrip buttons.Each button has a Tag to indicate the state (expanded or collapsed) and each panel has a numeric tag for the height it would have when expanded.
Here is the code.
Private Sub Buttonclick(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles TSB_1.Click, TSB_2.Click, TSB_3.Click, TSB_4.Click, _
TSB_5.Click, TSB_6.Click
[CODE]...
So...what I would like to have is an evaluaion of this small code. It seems to be a bit larger than the code I could write in VB 6.0 and I'm sure that there is a better way.
I have this code in c:
void Back()
for(i=1;i<=n;i++)
cin>>a[i]; 'display vector a[i] a[i] is a vector with 10elements
while(k>0) 'while k is greater than 0
[Code]...
This link offers sample code to infer the schema of an XML file, in VB.NET. One particular line fails in my translation to C#, namely,
Dim schema As XmlSchema = schemaSet.Schemas()(0)
My translation is
XmlSchema schema = schemaSet.Schemas()[0];
[code].....
Been using C# and code snippets and fill 'em in and hit "Enter" and POOF there you go, all done.
So how the heck do I do this in VB? Example: "property" TAB TAB brings up the snippet. I fill it in just fine .. NOW WHAT? Hitting enter just give me a new line. ESC doesn't do anything. CTLR-K CTRLX doesn't either.
What's the secret? How do I get the snippet to accept my entries and unsnippetize itself into inserted code?
I've been trying to write this snippet of code in VB, can anyone see what is wrong with it? I am recieving an error on line 5.
Dim a1 = From rows In db.tPDMLinkUsages _
Where (rows.ACCESSDATE >= DateTime.Today.AddDays(-90)) _
Select New With _
{ _
[CODE]...
Dim strFilename As String strFilename = Format(Now, "ddmmyyyyhhmmss"
That generates the day number month and so on. But i want to generate a string with "VB Code Snippet" then after that just any 5 letters or numbers so it might generate "VB Code Snippet 7ef82"
i'm coding a small app.i need to use regular expressions.I've got a huge string. and i need to find some substrings and put them into variables.for instance:<span class="(some constant class)">sb's Name</span> I need to cut "sb's Name" and put it into variable.how to do this using regular expressions?I know, that I can use webbrowser and whole DOM structure connected with it. But I can't, so I must use RegExp.
View 1 RepliesIve been trying to translate part of a code using this websites : http:[url]...
But I could not make it work specially this part :
bw.DoWork += delegate(object sender2, DoWorkEventArgs e2)
{
lastImageUploadDetails = uploader.UploadImage(txtFilePath.Text, resizeWidth, resizeHeight);
};[code