I'm making an art program involving 8x8 squares on a grid, but there are 64x64 grid square PictureBoxes for each grid square. Meaning there are 4096 picturebox squares to be setup.
I'm having them names like pic0001, pic0002, pic0003, etc... but re-naming them individually would take me forever.
I'm making an art program involving 8x8 squares on a grid, but there are 64x64 grid square PictureBoxes for each grid square. Meaning there are 4096 picturebox squares to be setup.
I'm having them names like pic0001, pic0002, pic0003, etc... but re-naming them individually would take me forever. Is there a way to mass re-name them at once?
I'm creating a car class. Make and model are properties but both make and model appear to be reserved words in C#. What's the best practice for naming properties/methods when your preferred name is a reserved word?My first instinct is to call the properties CarMake, CarModel (so a convention of ClassNamePropertyName).My mistake, make and model aren't actually reserved words. VS intelliesense and code coloring made it appear so to me at first glance. Though my question does stand for future reference.
Is there any way to get common control names like Save, Copy or Undo Redo in the user's windows language? (I saw this in some programs which weren't made for my windows language. Also the Yes No Massage Boxes will change...)
I have looked around the forums and found a few discussions on this, but none that address my issue.
I want to rename a folder of jpgs with their datetime original from the exif meta file. The line: My.Computer.FileSystem.RenameFile(foundImage, NewPictureName) does have the all the right info: the original file folder and name; and the new picture name - it just doesn't actually do the task.
Here's the sub:
If FolderBrowserDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then lblSelPath.Text = FolderBrowserDialog1.SelectedPath For Each foundImage As String In _
I'm looking for a way to detect when a new USB mass storage device is inserted in one of the pc's USB ports... I need to get it's drive letter and check for the existence of a particular file.
I have a program that will rename files that the user selects. The problem is even though when you go through the whole process, and it works successfully, it doesn't rename every file.To all people new to vb, try not to code like this as it is about the worst way to use a loop. I was in a hurry last night so i took the easy way out [code]Again, bad coding practices throughout the whole project, but the program will probably only be used by my dad so it will do.Note that the form: "Name and Ext" will not be shown when the program is all finished. I only had that visible for now so that i can check to see that everything is executing correctly.
I have been struggling a bit trying to get this to work. I am trying to rename the file but can't seem to get it to work. The file creates but just doesn't seem to rename with the text in the text box. Below is the code.
Code to generate File
Private Sub btnOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOK.Click If File.Exists("c:Sample.txt") Then
I have to rename a bunch of folders in different directories. What I would like to do is type in a directory and rename/move files into another directory. I have 4 txt files right know, one for the old file names, one for the new file names, and 2 for the directories.
I planed on importing the txt files into 4 arrays and then using the rename function to change the directory going through a loop.
Problem is I'm very very new to VB and have no idea how to import each line of the txt file into the array.
In one program i'm making, I have a little problem.In this application I have 25 button, wich I must have enable or disable everytime.How can I sned a part of name of the button? For example, if I have one array with the values:[bt1, bt2, bt3, bt4, bt5....] witch is the name of each control.Is possible someting similar this? :
Let's say I have the following class structure (simplified from my real-world problem):
Public Class PC_People_Container Private _people_list As New List(Of PL_Person) Public Sub New()[code].....
If I were to serialize this, I'd get the default assigned node names in my XML. That means my root is named PC_People_Container and each person in the list is marked up as PL_Person. I know I can change the root node using <XmlRoot(ElementName :="PeopleContainer")>. The trouble is doing that for the subclasses. I can't use the <XmlRoot> tag on PL_Person class because there can't be two root elements, and IntelliSense throws a fit when I try to use the <XmlElement> tag on a class like I would on a property. Is it even possible to control what those subclasses are named when they're serialized as child nodes?
How do i edit the column header of the GridView control on a web form? I have added a Table to DataSource as:
Me.gvSearchBrandList.DataSource = ds.Tables(0)
in here "gvSearchBrandList" GridView control But the GridView control display the column headers of the Table in the database. But how do i edit those column name in the GridView?
How do you use a parameterized query to make the (last_name, first_Name) appear in the same combo box? I know how do drag them over from the DATA SOURCES menu, but I am trying to combine them. So instead of it being two separate combo boxes with both last_name and first_name), it want it to find the the names with first and last name in the same combo box.
I have a WinForms applciation, I wrote a function that returns a list of all the controls on the form. The function returns a list of control objects.My target is to fill up a combo box with a list of the control names so that once clicked I set focus to it.So what is the correct code for converting a List(Of Control) to an array of string.
Okay, so the title was horrible. I know that. Here's what I'm trying to do:I have a lot of data that's coming from a database and being adding to a listbox. The data that's coming from the database is a unique ID, and a name. Is there any way I can make the item contain both the ID and name? I know I can append it, that's not what I'm looking to do. I need a way to be able to either get the ID, or get the name, while displaying them both.I have gotten as far as creating a class:
Class Item Property ID as Integer Property Name as String
I am coding an invoicing application. The user should be able to add a new line to the billing section of the invoice by selecting a product from a ComboBox, which subsequently fills out various other fields (price, description, etc) based on the selected product.
My problem is this: When the user adds a product, I would like the program to automatically generate a new line for the next product. It seems like the only way to accomplish this would be to create a new set of controls with an incremented name, i.e. Product1, Price1, Desc1 for the first product, Product2, Price2, Desc2 for the second product, etc. Is this possible, or am I going about it all wrong?
I am using Visual Basic 2008 Pro. I am trying to figure out how to bind a set of column headings in a DataSet (or DataGridView) to a ListBox. I want to show the column headers in the listbox control (not the data), and allow users to select one or more items
I don't usually use VB but now I must for an assignment. I would like to know if it's possible to change the display name for an object on a listbox. For instance, if I add to it a user defined class, there's a way to provide it's display name, instead of converting it to string and then add it.
This is what I have
Dim format As String = FormatOutput(object) Lista.Items.Add(format)
I would like to have the same output, but instead add the object.
Note: if such is not possible, then how can I associate the list box selection to the actual object? Doing it by index is painfull, because I'm using linked lists (ie., instead of arrays).
Note 2: python has a __str__ method which is called by default when the object is cast to string. Is there anything like it in VB?
I need to iterate through controls using dynamic construction of control names and it looks like this could be what I need, however I never used this before and it does not quite work. What am I doing wrong? GroupBox1 is what I am attempting
Dim x as Integer = 1 For Each ctrl As Control In CallByName(Me, "GroupBox" & CStr(x), CallType.Method).Controls The runtime error is "GroupBox1" not found on Form1 even though I can select Me.GroupBox1 from the dropdown list.
I am working on my first VB application and have run into a problem. I am trying to loop through some data and displaying them in labels. I am using a for-each loop but end up with different row with the same labelname. What I would like to do, is to assign a number to the labelname (mylabel1, mylabel2,...), but I canīt figure out how, and I cant find anything online that will work. Here are some of the code that I have made, where I could use a solution to my problem...
I've created a Custom Control, and I will be placing a large number of instances of that Custom Control on my xaml page. In working with that Custom Control in the VB Code Behind, how do I do the following?
How do I reference the name of the Custom Control (in my VB code) which was clicked with the MouseLeftButtonDown event? For example, if I have 10 instances of my Custom Control in xaml, each with a different x:name (say 1-10), when a particular instance is clicked, how can I see which one was clicked? I've tried a number of things including e.OriginalSource.Name (which returns the component within the control which was clicked and not the name of the instance of the control). My Custom Control consists of numerous parts and pieces (Rectangles, Lines, Text, etc). Each of these items is a part of my layer. In VB code, once I can reference a particular Control, how can I hide or change certain parts of that control (such as hiding a Line, and changing the text). Also, I need to modify more than just the control which was clicked, so I need to be able to access properties of all of the controls, not just what was clicked. For example, if I click Control instance Test1, I also need to modify Test2, Test3, and Test5 in some way.
Here is some test code I through together as part of a Silverlight project using MS Blend 2. My control is much larger, and I need 200 - 250 instances/copies of that custom control, so I really need to know which control instance/copy was clicked.
The objects I am trying to mass select are text boxes, and I am trying to select them all, without tediously selecting all of them, to see if any are blank and place in a 0 if any are.
I am using a Microsoft Chart control (system.windows.forms.datavisualization.charting.chart) in a Windows forms application, vb.net 2008. I use folder paths for the x values in a pie chart. Chart control converts a name like c:ewfolder into c:[newline]ewfolder. I tried adding a slash, making it c:\newfolder, but this only changes it to c:[newline]ewfolder. Is there a workaround for this behavior?
In the windows form designer, I added a StatusStrip control, made some changes to adding items and changed the names of the items to names I would recognize, for instance I changed "ToolStripStatusLabel3" to "lblMode". All was fine until I inadvertenly deleted the StatusStrip. Now when I add it back to the form and try to change the name I get an error saying that the name "lblMode" is already in use. And sure enough it is listed in the items of the properties window, but not dislayed anywhere.
I am not sure how to resolve this. I know there is a window, I think its called "Project Designer" or something similar that is code where controls get added but I CANNOT find this window to view the code.