How To Make Class Convertible To Another One
Jan 3, 2010
Is it possible to make my custom item class so that I can put it straight into a listviewitem? What I mean is a listview and I want to be able to do Listview.items(0) = Item. Or is this not possible?
View 1 Replies
ADVERTISEMENT
Feb 10, 2012
I have 2 DataLists where one is nested in the other one. I have one line (Dim QID....) that keeps giving me problems, no matter what combination of code I can find online. I just want to be able to get the Hidden Field to show up as an integer so that my If statement will work.
Dim dl2 As DataList = CType(e.Item.FindControl("DataList2"), DataList)
Dim QID As Integer = Convert.ToInt32(e.Item.FindControl("HiddenField2"))
If QID = 33 Then
[code].....
View 1 Replies
May 15, 2009
I can't make difference between public class and private class and friend and protected friend class.
View 1 Replies
Feb 28, 2012
I am New to <acronym title="Visual Basic">Vb</acronym>.Net. this is my first test. i try to create small address book. but i don't know what wrong. it compile perfect but when it run it give error and not work. is there any other way to add same class like in class inside array?
[Code]...
View 6 Replies
Jan 13, 2010
Public Class form1
Private Sub btnAnswer_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAnswer.Click[code]........
how can i make vb realize that the side that is opposite of the given angle, has to be less than the other sides. Also im not sure what Acamar meant by If txtAngleA.Text <> "" AndAlso txtAngleB.Text <> "" AndAlso txtSideA.Text <> "" Then 'two angles and a side Because im not sure what <> does.
View 1 Replies
Jan 9, 2011
Can i make obejct of a VB class from C# class, if possible then what i'll have to do?
View 3 Replies
Jan 30, 2010
ok so i've got a Form class that inherits from System.Windows.Forms
the problem is that once i put that line in, the IDE automatically converts it into a class that has Designer enabled. how do i stop this behavior?
View 2 Replies
Aug 20, 2009
I made this class:
Imports System.IO.Ports
Public Class Controller
Dim Serial As New SerialPort
Dim CurrentAzimuth As String
Dim CurrentElevation As String
Public Function Open(ByVal COMPORT As String)
[Code] .....
And I want to use it in a form. How do I call this class "controller" and then what code do I need to use it in a windows form?
View 6 Replies
Feb 1, 2011
I have a class "Character" that holds character stats and skills. I make a new instance of it "MyCharacter". The problem is I would like to use it like this.
MyCharacter.stat.charactername ="whatever"
Where stat is another class within Character or
MyCharacter.skill.lockpick=10, b
But I can't seem to do it.
View 3 Replies
Dec 28, 2010
I am working on a program where I need to read files. I won't know how many buttons I need until run time. I can't figure out how to create a button class I can call at run time. Each button will represent a file. I want each button when clicked to open the correct file and place the data into a rich text box on the form.Also, I need buttons to appear tightly in a row or multiple rows.
View 2 Replies
Sep 28, 2009
I need to associate a name with numbers and do a search in a text file to see how many times that number shows up and display what classroom hes in and display that in a list box.
View 1 Replies
Apr 29, 2012
I want to make an accelerate method that adds 5 to the speed field each time it is called?
[Code]....
View 13 Replies
Feb 23, 2011
a common VB.NET class should look like the following:
Public Class MyClassName
End Class
Besides, I have already seen, if I remember correctly, all of the import statements visible just like in C#:
Imports System
Imports System.Data
Imports System.Linq
Public Class MyClassName
End Class
How to make these default imports visible by default in VB.NET using Visual Studio 2008?Is there some setting or the like in the options I shall set?
View 3 Replies
Jun 10, 2010
Having trouble accessing a dim variable inside a btOk or Load event. when I dim a variable that will be used a lot, do I need to make it a class and then referer to it?
View 7 Replies
Aug 21, 2011
Is there any way to make a class instance public?In my mainform I define an instance of a certain class and then later on in some other forms which appear I want to alter this class.I try and pass them through when creating new instances of these other forms and it tells me Error3<instance of the class I want> cannot expose type <the class> outside the project through class <the form I want to edit it with>Which I gather from documentation is about it defeating the purpose to have a private class suddenly be thrown aroudn.but then how do I make it public? I can't define it in the first place as public myXClass as XClass, it only accepts private.
View 6 Replies
Jul 26, 2010
I am a java developer that inherited a vb.net web application. This app relies on a VB class assembly that builds in to a dll. I have made some changes to this class assembly but I cant seem to get the vb.net app to pick up the changes. I thought that using regsvr32.exe or regasm.exe would do the trick but after reading a bit more they don't appear to do what I need.
When vb.net uses code such as this import where is it getting the reference to "MyClassName"?
<% Import namespace="MyClassName" %>
View 2 Replies
Jan 10, 2010
If we make a class and implement tostring, should we support some interface?
View 5 Replies
Nov 1, 2009
created a class that adds a TextBox with some custom properties to the toolbox. But it's only available when the project I created it in is opened itself. I'd like to have available it in the toolbox at all times.
View 3 Replies
May 4, 2010
Imports Microsoft.VisualBasic
Public Class DealSlot
Private mSlotType As String
[Code]...
View 6 Replies
Dec 13, 2010
I am wanting to make a class that can be referenced in from other applications. In this class I simply want to do a showdialog to a form. That form has a ssrs pre-defined within it and a viewer all set to show the report. But when I try and define that action I get that my form is now declaired
Imports System
Imports System.Drawing
Imports System.Collections
[Code]......
View 3 Replies
Jun 2, 2009
Hey im trying to make a DVD Player with MSWeb DVD Class , i know how to make a DVD Player but im trying to figure out how to downlaod MSWebDVD Class to Vista.
View 3 Replies
May 11, 2009
i have to make a project for my programming class in VB and this is basically what i want to do in pseudocode form
1. Display initial form
2. Choose from one of two to four choices (my discretion) via Button or radio, whichever is easier
3. once you click next, or the choice button, display next form depending on which choice and close the old form.
View 3 Replies
Aug 3, 2011
Generally speaking, a common VB.NET class should look like the following:Public Class MyClassNameEnd Class
View 1 Replies
Sep 27, 2010
ng to make a nice agenda program for my class.i made my form and i think it would be best if i can put the dates and the things for that date in a excel sheet.but i realy don't know how to read and write things in excel.(the date needs to come in collum A and the item for that date in collum B)can any one tell me how to make my program able to read (and show ) me the things in the sheet and how to make it posible to let me write things in the sheet using only my program.and can this be done whitout excel needing t open ( or at least be visible).
View 3 Replies
Sep 7, 2010
How can I make an array of objects in VB.net. Here is the requirement. Basically I have a class named hotel. I need to dynamically add customers to the hotel class using the Customer class. So basically if in the Hotel class I can have an array of Customer objects that would be great. How can I do this in VB .net ?
Public Class Hotel
' I need an array of Customer objects. objCustomers
End Class
[Code]......
View 2 Replies
Oct 15, 2011
I Want to make a class accept string variable like this
Dim mystring as custstring
mystring = "test var"
like how we declare string classes I tried to use property as such
Public class cust
dim inputstr as string = ""
Public Property cust() As String
Get
[code]....
But it doesn't seem to work?
View 14 Replies
Aug 6, 2010
I need use a collection of differents types, this is:id (long), name (string), type (integer), open (byte) idReg (integer)I would like use it like an array but using the "field" id as key. The only way that i found for do it possible is using a custom class and then a dictionary.This is the custom class:
Public Class frmColeccion
Private m_name As String
Private m_type As Integer
[code]....
View 8 Replies
Dec 12, 2011
I tried to make my ODBC Connection within the class. here's my class code
Public Class Library
Public Function Seek(ByVal Connection As Odbc.OdbcConnection, ByVal TableName As String, ByVal Field As String, ByVal Index As Long)
[Code]....
Here's my error: Unable to cast object of type 'System.Int32' to type 'System.Data.DataSet'. I am using VBdotNet2005
View 2 Replies
May 19, 2012
i am working on an examination system. the system has to compute the grades and position of each student per stream and per class.each class has got 4 streams. I save the studentsmarks in the database. i want the system to determine the positions of students and the position of each student to appear on the rtf.. report, for example:
Position in stream:4
Position in Class: 21
[code].....
View 3 Replies
May 18, 2012
I'm moving code from code-behind to classes and run into a problem. I have a method which makes a string (an html invoice). In the method a final amount is created. I want to make a class called Invoice which will have the method "CreateInvoice" which will return a string and I also want to set the finalCharge property of the object.[code]
View 1 Replies