I'm building a code editor app in VB.NET (Framework 4.0) and it opens all ".por" files into individual forms consisting of a MenuBar and TextBox (multi-line).Currently I have 20 forms (all duplicates of the first on I designed) and if there are say 4 ".por" files in a directory, the first four will open up while the others hide.
I think it would be far more efficient by coding a new form For each item in form1's ListView...but I want the next so many to be a copy of the first form I designed since I spent a good bit on it.
I have a simple database with our customers data. I'm using access database, dataset, and a datagridview. So when I selected a row, I want to make a new row with datas from selected row. Here is my code:
I have a console application. I get the console application's folder path via this code:
dim Folder as string Folder = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly.Location)
And I need to create a new file with this name Key.txt in the same folder as the console application. Because this file name is rather normal and there is possible duplicate in that folder. How do I prevent duplicate file name while still using simple name for that file?
i have wrote a loop to search for duplicate numbers within a column in a database which i have got fine but when i find a duplicate i would like to get the all of the row so if 33 was a duplicate i would like to get the following row.
33MarkWhitesideM12/07/1958Michaeluuu
I have tried to do this buy use something i saw on msnd's website:
Dim foundRow() As Data.DataRow = customerDS.Tables("Details").Select("HNCNO Like '33%'")
However if i change the line to notice the i beside the like
Dim foundRow() As Data.DataRow = customerDS.Tables("Details").Select("HNCNO Like 'i%'")
but i get Index was outside the bounds of the array. Ok i know that means that there is nothing in my array. What i would like is to find the duplicate row associated i. you will probably understand me better when you see the code.
Private Sub checkRowsForDups() Dim customerDS As DataSet Dim dupArray As New ArrayList
Basically what happens is each time it loops through it adds a number to the end of the string, and by the end I should end up with an array full of string in a format like "111 222 333 444 555 666" but I end up getting strings like this "111 111 222 222 333 333". The weird thing is, if I add a message box in every loop it works fine, but obviously I don't want a message box pooping up every time it loops through. What is causing this and how might I fix it
The code is: For x As Integer = 0 To (NumCards.Value - 1) NumRep = 0
here i am reading files from one root folder and after reading that we are moving that particular file Success folder and taking a copy of that in to back up folder normal
while reading file i will check file naming convention by targeting backup folder if suppose it was exists in backup folder then i m moving the file to duplicate folder
my problem if suppose again same file came to process this file already existed in duplicate folder how do send the file in to duplicate folder, unfornately i dint have any property as file rename
If File.Exists(Swift_Backup + "" + Path.GetFileName(CBFile)) Then ' File.Move(CBFile, Swift_Duplicate + "\" + Path.GetFileName(CBFile)) 'DUPLICATE FOLDER'
i want to delete existing data in datagridview using loop . i write code below:[code]but problem is that when data found and deleted row then orginal data index mismatch. and get error. how do make loop in up to down and delete row if match
I have a for loop which goes like this - for i = 0 as integer to 100 result &= "Name" & sqldr("name") result &= "Lastname" & sqldr("lastname") result &= "dob" & sqldr("dob") next
The sqldr is the sql datareader (not important here) I want my end result to be Name1 = Sam Lastname1 = Davis dob1 = 01/01/1966 Name2 = ... Name3 = And so on depending on how manyrecords are in database. How do I make this happen in this for loop?
I am writing an app to be a single button failover of a set of mirrored SQL servers. The app has to handle several other functions (enable/disable and start/stop of services, writing to local registry, copying files from server A to server B, initiating stored procedures, etc.)I have a collection of labels that indicate the status of 4 services on 2 servers, I wrote a function to check the services when passed the machine name, and the service name. Originally I just called the function 8 times (4 services, 2 machines) and populated the labels 'manually'. I have all of this within a timer so that the service status is refreshed every couple seconds. Id like to clean up the code to a single for/next loop that operates on 2 arrays (an array of service names, and an array of labels) such as:
'**Fetch_Status is the function that gets service status, it accepts 2 strings, machine name '**and service name and returns status "running", "Stopped", as my_status Dim Services() As String = {"Service1", "Service2", "Service3", etc.}
[code]....
The only reason I want the control array is to be able to use the .Text and .BackColor properties of the labels in the loop. If I make an array of strings with the label names it doesnt seem to pick that up.
I have a bound DGV that took a bit of work to get its columns set up. I'd like to show a 1-row version of this identical DGV on a second windows form. Is there a way to programatically place a copy on the second form. I would adjust the height and position of the 1-row version, and create a new binding source on the second form so that I could filter the data.
I want to create an application which can reset itself quickly and easily (without a function to do so). I thought one way to do this is to duplicate the form in it's original form (variables, etc) from the point it first loaded.This is how I thought it could be done:
1. Click button to restart application.
2. Form in use is duplicated by creating a new form with Dim newForm as new Form.
3. New form contains all properties of the original form at the time it was first created.
4. Original form is removed, and new form is used; thereby 'restarting' the application.
I can't find any simple way to do this without making a function which completely resets every variable and object (there's a fair number of them).
This problem should be a no-brainer for anyone that programs daily. I haven't worked in VB.NET in many many months, and all of my reference books are at home. I have to modify a program that I wrote a few years back. I need to add a new form to the project that is very similar to a form already in the project. I figured I would start with the existing form and modify it. I still need the existing form in the project, so I made a copy, renamed it to the new name, then copied it back to the folder in which my project resides. Now, I need to be able to add it to the project, but I'm having trouble figuring out how. So far, I have been able to add just the code without the form. If I try to add the form, it wants to create a new form. .
copy a form without getting Duplicate reference errors that you would have to fix.So This is what i did and i felt i should share it now that i figured it out
File > Export Template > Item Template > Select Form To Copy Then Solution Explorer > Right Click on project title > Add Item > Select Exported Template > Rename file > Add Item
I am trying to create a small form that will duplicate a users entry for them.On my form i have a text box and two CheckListBox controls and a button. The user should be able enter a value into the text box, and select multiple items from both CheckedListBoxes, when they click the submit button the details will be added to a DataGridView below.
This is an example,The user enters the value Audi A4 into the textbox.
The First Checked Lsit Box is called "Colour" and from the options the user checks 'Red' and 'Blue'.
The second Checked List Box is called "Number of Doors" and from the options the user checks '3' and '5'.
When the User clicks the submit button 4 rows will be added to the DataGridView with all the different combinations, as shown below:
Model Colour No# of Doors Audi A4 Red 3 Audi A4 Red 5 Audi A4 Blue 3 Audi A4 Blue 5
I am currently using this to populate the DataGridView:
I am working on the following scenario: I got an existing VB.net application. Now I have to add a login mechanism to it. What I want to do is, add another form to my project and show it before the 'real' form of the program is displayed, so that it can handle the login procedure.
I have 2 projects. The first project has a form called Form1 in it and I want to import this form into Project 2 and have it fully working without any problems.
How do I dynamically create a form from within an existing form.i.e. when a user clicks on a button on an existing form that I have, another form is dynamically created and shown modally for the user to enter specific data or as a dialog box to advise the user of a specific result.
I have this data in txt file and the data keeps changing all the time.
[code]...
I would like to read all lines and compare, if the same name and same address is found, which is in the [......], then i need to count it and show the most frequent buyer!should i read it all and put in array, and compare and put the duplicate data and count into another array?
im trying to add a "rating" system to an existing form (i.e 1 star, 2 Star or poor, average, good,excellent etc).Does anyone know of a way to achieve this that is aesthetically pleasing with good UX either in .Net or a free 3rd party control?
I have a form already created, but now want to expand the application.I created a MDIParent, but cant seem to find how to change the existing form to an MDI child.
Using the new Visual Basic 2005 Express Edition Beta.Created a project, form, controls, etc. Worked great. Love it, compiled perfectly.Saved everything, closed the program, went to bed. Woke up, opened the project, but now CAN NOT open the form (form1.vb) in Designer mode!! I can open the code, it's all there, exactly as I left it, but cannot get back to the designer mode to (easily) add more controls to it!F7 just opens the code, right-click just gives me code option, not designer option.This is amazingly frustrating..
How can I add a form from one project into a new project, I dont want all the code just the form layout.My form has alot of textboxes and labels and I dont want to have to recreate it. I see the insert from existing item but not sure how to get just design and layout?I am going from 2005 to 2008 express if that makes a difference
i am trying to add an existing form to my project to reuse. From solution explorer Add>>Add Existing Item i select [filename].vb. But i can only see the codes not the dialog items.
I have successfully created a new excel with the code
[xlApp = New Excel.ApplicationClass]
and can transfer and manipulate data from my VB2008 form back and forth with the spreadsheet One time only each time I try and add additional data it wants to open a new workbook with the same name but cant seem to get it to just add the additional info.
I have an MDI parent(MDIParent1) form with a child form(frmMain).The child form got a Tabcontrol(TabControl1) in it.I am trying to load other forms(say form1) in my application to this tabcontrol as tabpages. I use the following code for that