the problem - i have a list box, which i use to display info (obvs) but when i click on one of items in the list when debugging, i wondered if there was a way to store which one was selected in a variable?
dim selected as string
selected = 'vb variable for a click?
I have an app I'm working on with multiple forms. One of the forms, frmLocationInfo, has textboxes and comboboxes which are automatically populated based on a combobox selection from a previous form, frmLocations. I've been able to get any changes made to frmLocationInfo's textboxes to save to the SQL database, however, when attempting to select a different item from any of its comboboxes, it's not saving to the database and instead, I receive a "Procedure or function...has too many arguments specified" error.
Here is the code for the Save button: 'Save changes to Locations db Private Sub btnSaveClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
I have 13 variables, all called Items1, Items2, Items3 and so on. I have a combo box with items in, each time I click a button I want it so whatever is selected is stored in a variable and if the button is selected again then it stores whatever is selected in the next variable. I know all the code for selecting items in a combo box and transferring it to a variable but the problem I cannot do is the part where each time a button is clicked it stores whatever is selected in the combo box to the next variable.
I have a list with several fields that is created from dataset from a linqtosql query. At run-time, the user gets to specify what field he/she wants to display from the list. In other languages, I can dynamically do this like:
valueIwant=mylist(i).[fieldnameImInterestedIn]
Where 'fieldnameImInterstedIn is itself a variable. How do I do this in VB.Net?
non-working actual code follows:
Dim patientdata = (From patientvar In pdfdatacontext.tbPatients Where patientvar.PatientID = patientid) Dim patientlist = patientdata.ToList() fieldvalue=patientlist(0).(reportrow.userselectedfieldname)
I have 3 lists in my form.When 1 list is clicked, I want to drop the selection in the other 2 lists.
Private Sub lstPlaylist_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstPlaylist.SelectedIndexChanged lstArtist.ClearSelected()[code]....
This is my current code. When I click on lstPlaylist, it drops the selection for all lists.
I'm looking at modifying an application we use in the office, the program links to the phone system and allows us to cross caller ID with our database and dial numbers from the database.What I'm trying to work out is how to add a selection to the generic windows right click menu. ie I want to mark a phone number in say ie or word and 'right click' and be able to click 'dial' from the menu. What are these menu's called and can i access its components from VB?
When we left click a grid cell, or list item, it highlights. Left click outside it and the selection jumps to the new place.
I can RIGHT click anywhere in the grid without disturbing an existing highlight, but I want it to work more like windows explorer would in terms of file selection..
i.e. if I right click inside the range, the range stays, if I right click outside the range, the range moves to a new single cell that I just right flicked.
Try it now on this page. Select some text, right click on the selection and it stays. Right click outside the selection and it goes. In datagrid (for example), the selection can only be modified with a left click.
How can we change this so the selection behaviour of a datagrid/list is more like this text pane?
On a related note. If I left click in a textbox I can drag a selection out. If i wanted to right click and drag the selection out, would it be the same process? (It's for a custom string manipulation picker control..)
I have written all that is required at this point and have published the program. I thought that global variables were saved when the program terminated but, as I found out, they aren't. If anyone has any way of making the variables keep their values between uses of the program I would be very grateful as if the program is being run for the first time some global variables need to be set straight away (I have done this code). The variable types are: one boolean and a few strings.
I am looking for an easy way to save the value of a variable when a program is closed. And then when it is reopened the variable has the same value as what it was previously when the program was closed. The variable has an integer value.
on my Form I have a DataViewGrid and some textboxes with a save button (they are filled with additional data of the selected row).Save is disabled first, when I change something in the textboxes the save button is enabled.When the user changes a gow in the grid, I want to ask before changing the grid row, if he wants to save (if the button is enabled).I am using RowEnter but this is too late, then the selected row already changed (and my textboxes already got new data)...What event can I use to ask if I should save stuff before the user changes a row?Something like BeforeRowChanging with a chance to cancel changing the row?
I am trying to have a textbox to enter a run time in. i.e. 10:32 (ten minutes and 32 seconds). I will then need to have an if..then statement like this:
txtRun.text = Run If Run <= 9:12 then RunScore = 60
I have the following Public Class Payroll Private Sub DateTimePicker1_ValueChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DateTimePicker1.ValueChanged
[Code]...
and I'm trying to save the datetimepicker value as a variable to pass to a sql database. I'm just not sure what the datetimepicker value is, is it Me.DateTimePicker1.Value or is it dt?
I need to create a program which can press anywhere on the computer screen. I need to click once with the mouse, and then save those coordinates, and afterwards the program self press the mouse at the point. It needs to be an application - not an applet. I have read something about MouseEvent, but I cannot quite figure it out, how to get those coordinates. Currently I can create a program with presses at some coordinates I self gives values as points in the source, I did that with the Robot class.
I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this
Imports System.Data.SqlClient Imports System.Linq Public Class Form1
[code]....
I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.
Currently, I've encountered a problem where I do not how I can store the variable of my battery level in a text file. I tried .xml and .txt file and it returns me text which can't be read.The code related:
vb.net [code]Dim psBattery As PowerStatus = SystemInformation.PowerStatus Dim perFull As Single = psBattery.BatteryLifePercent
[code]....
The place where I do not know what to insert is the "Insert Battery Percentage Here" part so I guess that's the problem.For your info, if you were to use a MsgBox to display, the code which displays that would be <MsgBox("Total battery power remaining: " & perFull * 100 & "%")>
I want to have the browser to be directed to a certain url upon button click with the text inserted into the textbox place into the url. For example - [URL] No this isn't what I'm trying to do, but it gets the idea through.
I have 3 click events in my form. I have delcared a string variable called sVariable in the following format: Public sVariable As String but when I try to use the value from the sVariable variable then it does not pass the value to the other click events. so in the Button1_Click event i type the following
I am trying have a data grid selection populate a form. I am new to this.Basically I have a connection persistance object and I would like to call that and call a stored procedure with the value of the selection. The datagrid is bound to an object.
rewriting a class I use for saving Treeview data to a XML file for use of saving ListView data I can't really figure out the rewrite, I'm stucked, unfortunately Listviews seems to be a big problem for me in general.
Option Strict On
''' <summary> ''' The TreeViewDataAccess class allows the nodes within a TreeView to be ''' persisted to xml for later retrevial. ''' </summary>
osheet.Range("A1").Select 'The line below is the one I would like to know how should I write it in VB.NET: osheet.Range(Selection, Selection.end(xlDown)).Select
I'm wondering whether it is possible to declare a global variable in a click event. I need to declare an array of a specific size. The specific size is generated using a series of IF statements. I only need to know how to declare it.
I have added the monthly calendar to a new form and have a button that calls it, that works just fine. What I can't figure out is when I click on a date how to get that click to take that day and place it into a variable that I will use elsewhere.
I have an asp.net website to manage projects. I realized that when I click for the next project really fast and often it overrides all the next projects with the data of the first one. I call a method to save before to go for the next project. I use also a session variable for the id of the project.
EDIT: It looks like the sever stacks the save method and the ids but keeps the values of the first project in the controls this is the ajax that calls a server method to get the id and set it in an hidden field: