have the following code and would like to know how I can substitute the filename (i.e.,test.rtf) with the name of a Textbox. For example, I have several Textboxes that I want to add and associate individual comments to. That is, once the comment is created I will SaveFile with the TextBox name. Each of these Textboxes will have their own comment
Private Sub btnOpenFile_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOpenFile.Click
I have not tested this, but I am fairly certain it would not work.When my program installs, I want to ensure that the default SaveFile directory is into a directory under the program's directory.For example, if the program installs to C:Program FilesConcept VisionsWorldFileMaker, I want the SaveFile dialog to default to C:Program FilesConcept VisionsWorldFileMakerWorldFiles.I can see in the File System of the setup project, under the property 'DefaultLocation', it's value is:
[ProgramFilesFolder][Manufacturer][ProductName]With Manufacturer = Concept Visions and ProductName = WorldFileMaker, am I correct in assuming this would be C:Program FilesConcept VisionsWorldFileMaker on a default Windows machine?
Below is the code I use to open the SaveFileDialog to save the file. The line in bold is the line I have my question about. How do I get the saveFileDialog1.InitialDirectory = "C:Program FilesConcept VisionsWorldFileMakerWorldFiles" without actually hard-coding it as "C:Program FilesConcept VisionsWorldFileMakerWorldFiles"? I want to use a substitution variable similar to "[ProgramFilesFolder][Manufacturer][ProductName]".
Eventually, I want to learn how to allow the user to install in a folder of choice. If I am correct, I would need such a substitution variable.
I'm trying to get a VB.net (express 2010) app to connect to a socket server (keeping the connection open), how would I go about this? Right now it works using flash XMLsocket, I'm trying to build a new client without flash, using the existing server.Currently I'm just using a simple window displaying messages, and a place to send messages.
It says I'm connected, but it displays no messages, and sent messages appear to have no effect, when I telnet to the server using the same IP and port, I can see messages coming in to me, so i know i can connect to the server. Here is my code:
Imports System.Text Imports System.Net.Sockets Public Class Form1[code].......
What I need to do is create comboboxes populated with values from a CSV for each class object selected from an Active Directory schema.
So lets say twelve classes are selected, the next form will display the class names in a checkedlistbox and will require twelve comboboxes for associating AD classes to CSV fields. Since the number of AD classes selected will always vary, is there a practical way to code it so that the objects can be instantiated from values stored in a variable?
Other languages support macro substitution, where the variable's value is interpreted as a literal at runtime. Developing in Visual Studio 2005, VB version 8 .netFramework 2.0xxx
QuoteImports System.Data.OleDb Public Class admin Inherits System.Windows.Forms.Form Dim mypath = Application.StartupPath & "\db1.accdb" Dim connection As New OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source=d:\db1.accdb;Persist Security Info=False;")
I have an app that automates a Google query but I have to enter my search terms in the code each time before I build the app and that's crazy.....how can I fit a variable in here from a textbox?
I pasted the code here....but...the variable is needed at the line of code: txt.SetAttribute("value", "Sample Information") Sample Information is my search query but I want to be able to use a text box to input my own variable at run time.
Code: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Automate = True [Code] .....
Is it possible to use a variable for text box names?I have 25 student name, and grade boxes that need to appear and disappear depending on how large the student number was given to start with.So far i have had to use this if\then statement 25 times.
If txtStudentNum.Text = "" Then txtStudent1.Hide() txtGrade1.Hide() ElseIf txtStudentNum.Text > 0 Then
how would one go about cleaning up all of those if\then statements to clean up the clutter of the code?
Can someone give me a simple example on how can I store/appear in a variable/or a textbox a value that i retrieved from a database. The sql query is something like "Select Comment from Params where id =1".
Does variable total have to be converted back to string ie..Cstr(total) in order for the result of total to be displayed in the text box txtdisplay? I notice It will work if I convert it to string or If I leave total a double it will still display the result as a double. what is the correct programming practice? [code]
Well, my problems is follow. I use a textbox where the user can enter a text but which I would like to prefill out with a variable (later , with more experience, want to ask the AD for the username and put it in the box).
That means, when the user runs the app, automatically is the username written in the textbox without pushing a button but the user has the opportunity to change it (For example doesnt want the second surname).
How do I name a variable depending on what is in the textbox?
Like would it look like: Dim (textbox.text) as string etc.
The reason I want to do this is because the user is gonna click a button to create a task. When the button is pushed, a label is created by the code I already have, the problem is, I want them to be able to click the button more then once and new labels will appear below the one that just was there. By being able to name a variable by what is in the textbox, I will be able to do so many things.
I'm traying to write some query but I don't know much about DataBase. I have a variable that store the value entered on a textbox and I want to look value in the DataBase and then show the record on the DataGrid. I'm traying to build some query but I think I'm way off.
Using WPF, and VB.net, I want to update a textbox in a textblock with the current date and time. I use a timer, and it seems to be firing, and setting an object property to "Now".And I am using iNotifyPropertyChanged.All I get is an empty textbox with no data in it. Can you help? Maybe my context is off? [code]
i want to save a variable to application settings and i dont want it to be in my invisible textbox1.text. i just want a plain old variable that i can manipulate during runtime and then have it save it after i reload the application. what do i do instead of attaching my.settings to textbox1.text?
I'm relatively new to VB. I want to perform a SELECT statement that uses a variable to return a value, example; mysql> SELECT room_description FROM room_descriptions WHERE current_room = 'someVariable'; And display the result in a TextBox i.e. TextBox.text = someVariable. So how do I perform a query from VB that passes a variable? How do I assign the result to a variable?
am explaining this stupidly, but I'm still very much a VB newbie. This is a question about uni work, but it's not an assignment/test, just a little optional extension task.I have three text boxes, the first one is where the person's name is entered and the next two are where you enter the (same) person's score for two tests they have completed.
1.prompt a text string in 0 to 20 characters and then pass it as a input parameter to a Boolean-valued Function to check if the string is symmetric or not. Display the result.
2.The Einstein's equation E=mc2 relates three variables, E, m, and c. create four TextBoxes, two for the names of variables (E, m, c) and the other two for the values of corresponding variables. Based on the entered names and values, calculate and display the unknown variable in another TextBox.
I am binding a textbox's text value setting to my a variable in my configuration file. I only consider the input from this textbox to be valid if it's an integer number bigger than 1. Right now what I was doing is letting the user write whatever he wanted in the box, and I'd only let him save the settings after calling a validation function. The problem seems to be that my binding variable in the Settings class seems to be being updated as soon as the textbox is being edited, and that's a behaviour i'd like to skip. How can I do this?
I am a former IT student and have not used VB in a little while but feel it can come in handy to help me complete some tasks at work.I am trying to write a small program which will open a url + a number for each number entered into the textbox. As an example lets say the website is "www.google.com/id=" and I enter into a textbox 3 values such as "134,325,2112", www.google.com/id=134, www.google.com/id=325 and www.google.com/id=2112 would all open at once.
The purpose of this is at work, we have an employee database and would like to load multiple employees at once (upto 6 at a time) to compare profiles. The issue with doing this manually is we have to fill out the search criteria for each, instead, I would like to load a link with parameters in it already filled out + the employee number we are searching for each number entered into a textbox on a VB form.
I'm trying to make a program that can export my schedule into a CSV file to upload on to google calender.I need to extract some text within a textbox control. I'll show you an example.This is the text in the textbox:
I have a WinForms app with a multi-line textbox. This displays and retains (after loading from the DB) line break characters fine. However if I assign the TextBox.Text value to a string variable and then re-assign the variable back to the TextBox.Text property, the line break characters are lost and replaced with a square character (can't past them here as they just paste as a line break!)