In C# I can do this:new SomeObjectType("abc", 10);
In other words, I can call new without assigning the created instance to any variable. However, in VB.Net it seems I cannot do the same thing.New SomeObjectType("abc", 10) ' syntax error
I have a form that contains a lot of textboxes, I want to populate these boxes with values based on a certain criteria. Two integers are required to decide which boxes should be filled. When I added the textboxes to my form I named them with this in mind so my boxes are named textBox11, textBox46 etc where the number part of the name will represent the two integers which decide the box (none are greater than 9). So I basically need to compare the textbox I create in my code to the textboxes on my form to determine the ones to add text to. Here is a shortened version of what I am trying to achieve.
If nodes are created in a treeview in the "picture way of coding vb.net" i can assign a key to the node. I would like to do this by adding the key to the node in the code as i am using a query to extract the key froma database and want to assign each key to each node as they are created.How can i do this?
I have a VB.Net Windows app that has a form with a ComboBox. It's dropdown style is set to "DropDownList". When I retrieve a record from the DB, I'm trying to assign a value to the "Text" Property of the ComboBox but it's not taking it. I've tried using the "SelectedText", "SelectedItem" properties and they're not working either.
'm trying to store a new value within a variable and then compare it to the previous value of that variable using the Math.Min method. I have created two seperate variable 1 for the previous and one for the new but I can't seem to store it
I decided to learn Visual basic because I want to see actual results and I don't see any in C++
when I was following it I get "Declaration expected" I'm going to assume that there is something wrong with the way that I'm assigning the array it's values but I don't know what to do.
Public Class Form1 Dim player(2) As String player(0) = "Bob"
txtlocated is the id of the HTML textbox. I want to assign the value of the textbox to the string loc. When i debug it the loc is shown as null the textbox value is not passed into the string.
[code] i feel that it is a waste of code and should be shrunk down into some sort of loop. [code] i know i could easily leave it the way i originally had it, but i hate having wasted code!!
i want to set the default value of a combobox in my edit account module based on the levelofaccesstextbox in my login module but my codes doesn't work here's my code:
Private Sub editaccount_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If login.LevelofAccessTextBox.Text = "Student" Then With Me.ComboBox1.Items
OK, Well I'm creating a "Card" creating app. The app will let you type in the name you want in the name field and then select a picture. But the problem is, is the saving. I want the card to be transparent like the original. The original is just a blank card. And theres a picturebox on the form that shows the original transparent image, and then a label over the name tag part of the original transparent image, and then another picturebox over the original pictures box for the picture, everything works for designing and it looks great after your done designing the card. But saving will not be transparent and it will not blend with the background.
How do I add onto the image and still keep the transparency of the original and then save it?
This is my code:
Label1.SendToBack() PictureBox2.SendToBack() Dim Card As New Bitmap(Panel1.Width, Panel1.Height)
DataSource is of type Object while Tables("Customerslist") is of type DataTable. How will I know what types of objects can be assigned to the Datasource property?
i used this code to assign the brand dbs to a value of 200
[code]Private Sub xModelComboBox_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles xModelComboBox.SelectedIndexChanged If xModelComboBox.Text = "DBS" Then
I have a text file which I open and then read in 1 line at a time and split up. I then takes each component part from the split string and assign it into a variable as I go.
I then want to specific varaibles and put them into an array and build the array.
Can I read in each element and assign it directly into an array or is this was best.
also
I seem to be getting an error when I try and directly add items into an array
' myCarrier(98).EZY_Both = myCarrier(98).EZY_Both + 1 ' Structure Carriers Public BA As Long Public BA_Lev3 As Long
basically i've gotten myself into a mess with some last minute project work. shame on me and all that but thats college students for ya. basically i seem to be having problems assiging a simple integer to some pictures in an array. now. basically its a card deck. i've looked this up so many times yet nothing comes to me that fits my code or the way i've been taught. in any case i've got an imagelist and put it into an array to symbolize a deck. now. as i'm doing blackjack i need each card to have its own value. so obviously 2 of hearts value = 2, king = 10 etc.so what i've done is created a function that calls on a string. and used a select case to give a value based on the filepath of the image. however it failed hoplessly. heres a piece of the code:
Sub getcardvalues(ByVal card As String) Select Case card Case "decklist.images.item(2club.png)" value = 2
[code]....
despite this seemingly simple solution i can't seem to pull out the path of these cards as a string. the array simply gives me a number and the actual picture dosnt want to be a string. so my question is this. how can i pull the image path out of the array (eg: deck(1) = decklist.images.item(3club.png)) and turn that into a useable string?
I recently saw some VB .NET code as follows:[code]Does assigning Nothing to service do anything? If it is a garbage collection issue, I am assuming that when "service" went out of scope the referenced object would be garbage collected and the dispose method called on the object.It seems to me that assigning this variable Nothing can't really do anything, as there could be another reference to the object around so the reference counts haev to be checked anyways.
I'm trying to execute a vbscript programme, on execution I'm getting following errorme in coming out of the problem."Wrong number of arguments or invalid property assignment: wsh"
CODE snippet: Set xl=createobject("excel.application") Set wb=xl.workbooks.open(testset)
I'm creating a project that involves hot keys, but it requires multiple hot keys instead of assigning one. I'm going to make it so if a user presses for example CTRL + T on they keyboard while a textbox is selected, it'll show CTRL+T in the textbox and assign the key to do something. How do I do these though? Here's the code I've used for single hot keys:
I'm making a newsletter sending program and I save the RTF from a RichTextBox to a file. Another program reads it back, and assigns it to the Rtf property of another RichTextBox. I get an ArgumentException saying "File Format is not valid". Is there an extra step to assign RTF? Here's the important part of the code (mostly the last part that reads it back):
vb.net
Private Sub lnkNew_LinkClicked(ByVal sender As System.Object, ByVal e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles lnkNew.LinkClicked Dim f As New NewNewsletter()
I am having a problem with objects and arrays of objects. Basically obj_stored holds how many objects I have stored in my text file, in this case t shirts. line(y) is an array that holds each line that has been read from the text file. I then use this to assign values to my array objects properties. For example I know the first line is the color of the first t shirt, second size, third price etc. Then I know the next line will be the color of a new t shirt. There are 6 t shirts in the file.
Dim t_shirt(5) As Clothing.t_shirt Dim t_shirt_purchased As New Clothing.t_shirt For x = 0 To obj_stored t_shirt(x) = Clothing t_shirt(x).color = line(y) y = y + 1 t_shirt(x).size = line(y) y = y + 1 t_shirt(x).price = line(y) y = y + 1 Next MsgBox (t_shirt(4).size)
My problem is it seems to be resetting these values after it has finished. Im creating the object each time and assigning values to it's properties but when it's finished it all resets and says 'Object reference not set to an instance of an object'. I'm new to OOP and was wondering what sort of approach i would take to doing this, if the one i am taking is wrong.
So I am aiming to: Read everything in from the text file. Create new instances of the objects depending on how many t shirts are stored, (5 t shirts = 5 objects) Assign the values to my objects properties.
i have DataSet with 3 tables in it and i want to asign all 3 tables into one DataView.i know its possible to assign each table seperatly by doing this:
Dim dv as New DataView(ds.Tables(i)).DefaultView
but i need all the tables in the dataset and not only the i based index table i also thought about using DataViewManager which can be assigned to the whole Dataset, but it doesn't have the RowFilter prophety which i am using Later on my code.
I am having trouble assigning the "Author" property of a document.All other properties function as expected.No error occurs and the author is not assigned.[code]