Use CheckedListBox CheckChanged States In An If Construct?
Mar 1, 2010
I have a CheckedListBox populated with specific records from an Sql table . I want to update each record in the table, only if the checkbox checkedState = True, so far I can update all or none. This unworkable code will hopefully give an idea of what I need to do.
[Code]....
View 8 Replies
ADVERTISEMENT
Mar 8, 2012
I am a newbie to VB and I am trying to Insert/Delete records in a MSSQL database based on if a checkbox is checked or unchecked. The checkbox is an item template in a datagrid, I can check/uncheck the checkbox but it doesn't do an insert or delete. Here is my
ASPX Page:
HTML
<asp:TemplateColumn><ItemTemplate><asp:CheckBox runat="server" ID="chkMap"
[code].....
View 2 Replies
Jul 6, 2009
I'm trying to reset a form after a game has been played. I used checkboxes to indicate when the user picked a particular line item to update and then flagged the checkbox as checked and disabled.Once all the checkboxes have been checked, the game is over and I want to show a dialog (msgbox) that will allow the user to start a new game or exit the app. To reset the form, I was changing all the checkstates back to unchecked (along with resetting other variables), but the checkchanged events are being triggered and I end up in a loop.Is there a way to change the checkstate without triggering the event?[code]....
View 2 Replies
Jun 27, 2009
Can you temporarily disable a radio buttons CheckChanged Sub? I have a set of radio buttons in a groupbox and when the user selects one, I need to check if it's a valid selection. If not, I need to reset it to the previous button that was pressed. Below is an example of my
Private Sub rbGame_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rbGame.CheckedChanged
t_indextype = m_indextype
m_indextype = "1"
[CODE]..................
In the above example, ResetButtons() changes the checked value of the radiio button selected to false and changes the checked value of the previous radio button to true. The problem is that when radio button rbGame gets changed, it causes the CheckChanged sub above to run again from the top. Is there a way to temporarily disable it from running while I make my changes and then re-enable it?
View 4 Replies
Dec 11, 2011
I was asked by a client to create a tool that would let a user add/modify/delete/read content from a database. The content can be read from TextBoxes.
My question is, what is the best way to manage GUI locks/unlocks for the different states of the program. IE: If I'm in a "insert" mode, some GUI elements should be enabled, and some not. If I'm in the "read-only" mode, a bunch of them should be disabled... etc.
View 1 Replies
Mar 24, 2010
I am having difficulties populating a checkedlistbox (CLB) based on the selection(s) made in another. It should also be noted that I have a "Select All" checkbox at the top that checks/unchecks all of the items in the first CLB. Here's the code:
[Code]...
The first CLB is populated with an arraylist of values on the button click event. Based on whatever is checked in the first CLB, corresponding values from an arraylist of structures should fill the second CLB.The following code partially works until the "Select All" checkbox is clicked at which point if other values have been selected before "Select All" is checked, the second CLB is filled with the correct number of corresponding values BUT only those of the most recently selected item of the first CLB instead of all of corresponding values of all of the items that were not already selected.
View 1 Replies
Mar 16, 2010
I have a bit strange problem in my application. I have more binding sources then one in my different forms. All of them work great when editing, deleting the data except one. But this one is a bit different from others. I'm using it only for updating and deleting. You can't add new records using it. And also its dataset doesn't contains any Insert commands in it. That's the difference.Now problem is:
After deleted the rows (using BindingSource.RemoveCurrent), it doesn't mark rows as deleted. I call BindingSource.Count method after deleted rows, it sill counts deleted rows. So it seems it doesn't update the dataset. But it is. Dataset.HasChanges returns true.
View 5 Replies
Oct 27, 2009
I need to construct a data array and I am not sure if I can do what I need to do given the data. I probably should opt to store in a new class but that's too advanced for now
the data describes a series of points. each point has its index in a list a boolean, binary value and a list of integers of its neighbour points. so i thought it would be three columns and the third column would store a list. can you do this?
I presume i could get rid of the column dedicated to storing the integers..
View 13 Replies
Dec 20, 2009
I need to construct an XML transaction of the following format[code]...
I was thinking of creating a "GetXml" function on my object that returns the XML representation of the values in the object instance.I could do all the string concatenation myself, but surely there is a cleaner way.
View 4 Replies
Dec 31, 2009
I have an application in VB.Net and now I find out an API is not compatible and requires VB6. I am trying to convert it back to VB6 and have an issue in a Class Module. In VB.Net, I have:
[Code]...
View 7 Replies
Dec 20, 2010
In my career I have seen literally dozens of ways that people choose to handle implementing state and country data (as in NY or USA). I've seen enumerations, multi-dimensional arrays, data driven classes from XML docs or databases, and good old-fashioned strings.
So, I'm wondering, what do people consider the "best way" to handle this very common implementation? I know that most of the answers will be based primarily on opinion and preference; but, I'm curious to hear arguments as a recent discussion for an app I'm working on has resulted in a small debate.
View 3 Replies
Jun 21, 2010
Im having some trouble to construct a Master-Details form. When I navigate through each record on the master nothing happens on the details. This is so even if there exit a relation between the two tables in the database and in the dataset between the data table. Can anyone provide me with some samples or examples of coding how to proceed?
Furthermore I have tried to programmatically create the relation but the following error occurs: child list for field cannot be created etc
View 1 Replies
Aug 3, 2011
This is probably a dumb question but I have to call one of 30 or so global variables by constructing the variable name to be called from another information. However when i do that it treats it as a string. Any ideas on how to make this work?eg something like this:
Public gsNewYork As String
public sub Getinfo
dim lslocation as string
[code].....
View 1 Replies
Mar 11, 2009
I am going to construct a VB program that will calculate dog and cat ages, i plan to have a user interface to ask the user if they have a cat or a dog, then id like another window appear to ask how many human years of age is your dog/cat, up to the age of 20 (in human years) with that input the calculator will give you the age equivilent in dog/cat years.
View 1 Replies
Jul 17, 2010
I am looking for a way to read an XML file at run time and construct an Enumerator from it. I got the reading and writing all working, it's just getting all the strings to create an enumerator that's the tricky part. I could get them into a collection of strings or maybe a dictionary, but not sure how to go about converting from these into an enumerator. The goal of this is to allow users to add and delete items from the underlying enumerators and eliminate writing hard coded enumerators. My idea is to allow users to extend the program without coding. This is a Winform vb app thats not using any database but just XML files to store and retrieve things.
View 7 Replies
Jul 15, 2011
Is it possible to construct the name of an object (in this case, a Panel control) at runtime?
What I want to do is change the Backcolor of one Panel that is a member of about fifty panels. I can get the string of the name from the Sender in a RadioButton CheckedChanged event. So what I want to do is something like:
PanelName = sender.parent.name & ".BackColor"
PanelName = Color.Red
(I realize that the syntax above is invalid. I'm just using it to try to get the idea across.)
I can do what I need with big, fifty-element Select Case blocks, but the code is so repetitive that I was hoping there was a more elegant way.
View 7 Replies
Aug 23, 2009
I have a spreadsheet with Proj Numbers: "049410-001" in column B6:B60. I have the URL to the Database: I want the links to show up in the A column with the Tag being the Proj Number "049410-001".
Also, if I could clear the A column and use it "A column" to enter the Proj Numbers and then run the Macro to enable the Hyperlinks I could eleminate the Proj number taking up 2 columns. I have 80 rows set aside for projects so it needs to go through and enable the links that have text in them.
i used =HYPERLINK(E24,B105) (E24 was another wasted cell that combined the static first part of the link, and the proj) as the formula way to do it, but I'm trying to make a Macro that does it behind the scene. but I am just getting into VBA, and I have no idea what i'm looking at when I look at a code.
View 3 Replies
Oct 13, 2009
I am having with what appears to be a ASP.NET page life cycle issue. I currently have a user control embedded into my page. Now depending on the options chosen from the menu item list, the page can be in one of three states represented by a PageStates Enum within the control. The page on selecting the menu item merely updates the a property exposed from the control
Initial State (nothing congifurable)
Editing (this uses a dropdown extender and makes a gridview within it visible)
Adding (this uses another dropdown extender and makes the same the gridview visible however with different properties)
PROBLEMS
The page will only get itself into the correct 'state' if the menu item is selected twice Controls are visible on the gridview when they shouldn't be The page 'state' seems to lag one state behind
I think the main problem I having with this is that the grid view has check boxes drawn if the page is Adding mode, however you would need to select the Adding menu item option twice to get it into this state and I believe it is because I am setting the page state when the menu item is selected however the grid rows are already created at this point ( I am dynamically creating the check boxes in the grid view within the RowCreated event
View 2 Replies
Mar 20, 2011
I have two listboxes: lstStates and lstOuput
I have cut and paste the fifty states on one box in the order in which they entered the union. I have two buttons, one to alphabetize the states and one to reverse alphabetize the list. Here is the code for alphabetizing the list:
Private Sub btnAlpha_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnAlpha.Click
lstOutput.Sorted = True
[Code].....
How can I put the list in reverse abc order without using an array? I've tried a variation of the above code, but it did not work?
View 2 Replies
Jun 4, 2010
I have a stack of 2D dicom images and want to convert to a 3D object using VB.NET. I suppose I can solve it using openGL but any clue would help a lot. Do you know a free (or at least cheap) pack to do it?
View 1 Replies
Mar 1, 2009
I was trying to figure out if anyone had any example of sending ICMP packets over a Socket, when it is in raw mode?It would need to construct the IP Header information, and the raw ICMP packet.
View 1 Replies
Sep 14, 2011
I need to display info about each of the 50 states when selected in my program. I have one combobox with all the states as items inside, one button that you click to get the info and one listview for displaying the info. Here is my code so far:
Imports System.Text.RegularExpressions
Public Class Form1
Private Function getinfo(ByVal state As String)
[Code]....
View 2 Replies
May 5, 2012
I did a MDI Winforms application and noticed behaviour that I have a question for. If one of the forms is opened with a Maximized Window State and another form is opened with a Normal Window State, the form Window State that used to be Maximized is changed to Normal. Can several windows be open in a MDI form with different window states at the same?
View 1 Replies
Feb 13, 2009
I need to use select case to input a month by using its number IE: january = 1, february = 2 etc. when the month is inputted, how many days in that month is the output. I have to take into consideration leap year. the years I am using to determine leap year is 2004,2008,2012,2016 Here is the code I have so far:
Module Module1
Sub Main()
Dim monthnumber As Integer
[code].....
View 12 Replies
Mar 7, 2012
I'm trying to use the .NextResult() method of a DataReader but I get an error that no data is present.
The 1st query returns a value but the 2nd query is the problem.
Dim strSqlStatement As String = "Select Count(*) As TotalRows " & _
"From Parents " & _
"Where (FatherName = @SearchValue " & _
[Code]......
View 1 Replies
May 10, 2011
I'm working on a project where I need to trigger an event when a switch is closed. It is my understanding that it is possible to use the control lines on a serial port and read whether the switch is closed or not. I've found a schematic of how to connect the switches to the pins, but I have not been able to find any example code on how you can read the state of the switches.
View 2 Replies
Nov 30, 2010
I am currently developing a chat application and am trying to include:
Various states, like MSN does, available, busy and away.If the user doesn't touch the keyboard for one minute, the state of the user isto be changed into Away.Or something similar to these.I also need the program to be able to play a sound while running.
View 1 Replies
Nov 29, 2011
I have to make a program that uses 2 arrays, one with the states name and one with the capitals names. I have to make it to where it randomly selects a state and asks you what the capital is, and gives you 4 choices in the 4 radio buttons provided. My problem is getting one of the randomly selected answer choices to be the Correct answer.
Here is my code so far:
Public Class USCapitals
' Declare module level variables.
[Code] .....
View 3 Replies
Sep 12, 2009
I have a treeview control on my form, i am trying to load an xml into the treeview to show cities/states (example at the bottom of the page)The xml that treeview is loading from looks like:
vb.net
<?xml version="1.0" encoding="utf-8" ?>
<Locations>
<Group name="US States">
[code]....
View 4 Replies
Mar 31, 2011
Working with System.Cryptography, I'm noticing that data arrays up to a certain size will either conform to the size of the Initialization Vector (IV) or the size of the Key provided. So with a 48-byte Key and a 32-byte IV, up to around 42 bytes of data will encrypt to 32 bytes and 44+ will encrypt to 48 bytes of data. I've tested this with a variety of data arrays, and it seems to always come out the same... but I have a concern that higher byte values in the original array may result in longer encrypted arrays.
how or whether I can construct byte arrays that will be guaranteed to come out of Encryption at a pre-determined size?
View 16 Replies