VS 2010 If .NET Has The "|=" Operator That Is Present In CSharp Or If It Goes By Another Name?
Dec 5, 2011I am wondering if VB.NET has the "|=" Operator that is present in CSharp or if it goes by another name.
View 8 RepliesI am wondering if VB.NET has the "|=" Operator that is present in CSharp or if it goes by another name.
View 8 Replieswhat's the vb.Net counterpart of the following blocks in Csharp?
[Code]...
What the vb.net code should be of below c sharp code? [code]
View 1 RepliesI have been trying to design a custom tabcontrol in vb.net used a codeproject example to develop the said tabcontrol but the example is in C# I have converted all parts and theres only one error i cant seem to work around
[Code]...
if this is the wrong section since my result code will ve in vb thats why i posted it here.
what's the vb.Net counterpart of the following blocks in Csharp?
public class NullableDateTimePicker : System.Windows.Forms.DateTimePicker
{
Default Constructor
public NullableDateTimePicker() : base()
{
[code].....
i want to know how I could run a Csharp form from a VB project by pressing on a button.
View 6 RepliesVB.NETbyte[] packetTemp;
packetTemp[1] = (byte)pSize1;
return new byte[0];
CSharp (converted but i don't think they are correct):Dim packetTemp As Byte();
Return New Byte() {0}
I have some code that was written in C# and am attempting to convert it to VB.Net, for the most part things have gone well but I am running into an issue that I am not sure how to handle. The project has several classes and a few namespaces defined. The issue is [or seems to be] related to the namespace usage.
In the C# code of one class I have
Code:
namespace GdiPlusLib
In another class I have
Code:
using GdiPlusLib;
When translated to VB I have in the first class above
Code:
Namespace GdiPlusLib
and the following in the other class from above.
Code:
Imports GdiPlusLib
I get the following warning message on the imports line
Namespace or type specified in the Imports 'GdiPlusLib' doesn't contain any public member or cannot be found. Make sure the namespace or the type is defined and contains at least one public member. Make sure the imported element name doesn't use any aliases. There is another instance with a different namespace that gives the same warning and I get 11 errors all of which would seem to be related to the two warnings.
Let's say we have the following
Dim number1 as double = 2.24
Dim number2 as double = 12
Dim symbol as string = "-" (or "+" or "*" or "/")
How is it possible to execute this operation using the operator from the variable?
I'm having a contextmenu in a datagridview. I need to disable a menuitem if there is no value in the currentrow.cells(..).value.I tried several thing, but no luck: If dgv.currentrows.cells(1).value= "" then... 'disabe menuitem. I'm getting the error: Operator '=' is not defined for type 'DBNull' and type 'Integer'.
View 3 RepliesI am trying to convert a piece of C# code, and I ran it through a converter, and had to make some changes.I am now running into this error:
Operator '<<' is not defined for types 'Char' and 'Integer'
The code is:
a += CType(URL(k + 0) + (URL(k + 1) << 8) + (URL(k + 2) << 16) + (URL(k + 3) << 24), UInt32)
b += CType(URL(k + 4) + (URL(k + 5) << 8) + (URL(k + 6) << 16) + (URL(k + 7) << 24), UInt32)
c += CType(URL(k + 8) + (URL(k + 9) << 8) + (URL(k + 10) << 16) + (URL(k + 11) << 24), UInt32)
The error occurs on each of the (URL(...) << X)
I am tightening up my coding with the Option Strict set to ON. It has now produced alot of errors. An example of this is:
If AllocatedDGV.Rows(i).Cells("RoomNumber").Value = RoomsAvailableDGV.Rows(j).Cells("RoomName").Value Then
It gives me the following error: Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity.
I need to write an interface to get data to/from our data files.
We have a low level class that holds field values for each record read from the files.
This just holds two values, the value read from the file (DBValue) and the updated value that may need to be written back to the file (CurrentValue).
These values may be any of the standard value types (integer, date etc) or a string.
Either value (DBValue or CurrentValue) may be null if not defined.
I have written the class to manage this data which works fine while option strict is NOT on.
But we have an office policy of having option strict on all the time.
When I put option strict on, my object value comparisons fail with the error: "Option Strict On disallows operands of type Object for operator '='. Use the 'Is' operator to test for object identity."
Question, how should I change the following code to handle option strict on ...
This is all running on Visual Studio 2010
[Code]...
Possible Duplicate: Is there a conditional ternary operator in VB.NET?
Can we use Coalesce operator(??) and conditional ternary operator(:) in VB.NET as in C#?
Dim cellidentification = ComboBox1.SelectedItem
Dim SCR = ComboBox2.SelectedItem
Dim mySelectQuery1 As String = "SELECT [" +
[code].....
I want to perform equality comparison in VB.NET and cannot get it to work. Error: value of type Boolean can not be converted to System.Drawing.PointF
[code]...
If i type this in:
CODE:
I get an error: Error 1 Operator '=' is not defined for types 'System.Drawing.Image' and 'System.Drawing.Bitmap'.
I have also used 'is' instead of '=' but that doesn't work either.
I have 2 comboboxes who are loaded on the formload event with the folloving
[Code]...
The following line of code gives a warning with Resharper: 'Comparison of floating point numbers with equality operator. Possible loss of precision while rounding values.'
Dim samples() As Single
If samples(i) = Nothing Then
samples(i) = _mPreviousSamples(i)
End If
What is the best way of checking if a value is present?
How can i find out whether a BOM is present in a file or not. Depending on the presence of BOM i need to parse a UTF-16,UTF-8 file else I have to display Incompatible format.Kindly tell me what is the procedure to find if BOM is present or not. I have tried using FF FE for UTF-16 and for UTF-8 Bom. but i need to find whether this BOM is present or not how can i do it in VB.Net
View 2 Repliesi am getting following error when i am running AJAX enabled ASP.Net application
The control with ID 'FilteredTextBoxExtender1' requires a ScriptManager on the page. The ScriptManager must appear before any controls that need it.
even though i have ScriptManager in my page
<form id="form1" runat="server">
<asp:scriptmanager id="ScriptManager1" runat="server" />
<div>
[Code].....
what i need is i what to get all information within the parenthesis of Sin().for example , i have created one one textbox in my user interface.i wanted users to enter some trigonometric expresiions like " sin(90+(25+25))"for that i what all the information present with in the parenthesis of sin()
view sourceprint?
01
Public Class Form1
02
[code]....
I have a web application with a number of pages, I would like to display the sitemaps for this application diagrammatically, is there a professional/recommended tool for doing this? I am using MS Word using flowcharts, but it doesnt look very professional.
View 1 Repliesthis is pradeep, i m vb.net learner,my English not good dont mind what i need is i what to get all information within the parenthesis of Sin().for example , i have created one one textbox in my user interface.i wanted users to enter some trigonometric expresiions like " sin(90+(25+25))"for that i what all the information present with in the parenthesis of sin()
View 5 RepliesI'm an avid programmer, and I'm trying to teach myself more professional practices, but Ilook over my code, and point out any mistakes, or bad practices I may have attached to this actually working bit of code. It consists of a procedure for retrieving, sending, and above all connecting to a server program. As for the various amounts of sloppy commented out code, after a long time clearing my head, I came to my senses so to speak.
Imports System.Net.Sockets
Imports System.Text
Imports System.Threading.Thread
I would like to know if it's possible run a form without present it in the screen...
View 14 RepliesI am in the process of creating a program that is linked to a database. I want to automatically generate a reference number that is not already present in this database, to do this i know i am going to need to search the database to check whether that number is already present or not. But I am unsure of the best way to go about this. I am using an access database and vb.net.
View 8 RepliesI've been getting the following error from time to time and have been unable to determine the cause of it:"The given key was not present in the dictionary."The line that this is occurring on is:If CType(ViewState("FieldType"), MYClass.FieldType) = MYClass.FieldType.ShowOnDirectory ThenI have no idea as to why it is throwing this exception on this line. I thought that perhaps an invalid value was being placed in the ViewState so I tried while debugging setting the value to Nothing and setting it to a value that wasn't in the enumeration and it still works. I was originally storing the enumeration in ViewState and then went to storing just the Integer equivalent in there
View 4 RepliesI'm working on a ASP.NET website project using VB.NET as backend code. I was looking for a way to show the header/footer of a gridview even if no data is present. I'd like to use this solution as it looks pretty clean (although it's written in C#): link I have converted the code using an online tool, resulting in: [URL] This however shows an error on line 77: "Events cannot be declared with a delegate type that has a return type"
View 1 RepliesI've started building a small game where you move around a PictureBox control with keystrokes using the arrow keys. Everything was working fine....until I added a button.
Now the button steals the focus so that every time I hit an arrow key hoping to move my image, it just selects the button.
Is there any way to make the button selectable only by mouse click?