VS 2010 : Multiple Alternative Selection Structure?

Feb 19, 2012

I am enrolled in a college course using Visual Basic 2010 Express.My current assignment calls for the following:Create a small program that allows a user to enter the total amount of purchases for the purpose of calculating rewards points based on the purchase totals vs. their membership level of basic, standard and premium.The user selects their membership level via 3 radio buttons, basic, standard or premium.

The total of purchases and their rewards points depend on the membership level. Example, if you are a basic customer and your total purchase is under $75, you receive 5% in rewards points (70 x 0.95). Additionally, if the total is between $75 and $149.99, you receive 7.5% rewards.Here is what I have so far, but I am getting errors on the ElseIf statements:

If basicRadioButton.Checked = True And totalTextBox.Text < 75 Then rewards = total * 0.95
ElseIf basicRadioButton.Checked = True And totalTextBox.Text > 74 AndAlso totalTextBox.Text < 149.99 then rewards = total * 0.925
ElseIf basicRadioButton.Checked = True And totalTextBox.Text > 150 Then rewards = total * 0.9

[code]....

View 5 Replies


ADVERTISEMENT

VS 2008; Selection Sort An Array Of Structure?

Nov 21, 2009

I have an array of structure and need to sort it using selection sort. I have to sort the array by the last name field in ascending order (A to Z). I dont understand how to use the selection sort method.

The code i have so far...

Public Class frmMain
Structure EmployeeInfo
Dim first As String

[Code].....

View 5 Replies

Program A Selection Structure To Display Different Commission Rates Per Sales Entered In A Textbox?

Apr 1, 2011

So I'm trying to program a selection structure to display different commission rates per sales entered in a textbox.I need to have the commission total display alone. I have the simple interface done, but I'm having trouble forming the selection structure.

View 1 Replies

VS 2010 - Alternative To YIELD Keyword In VB

Apr 19, 2011

I have a tricky piece of code in C# that I need translated to VB.NET. That's not usually a problem, as I can do it by hand or using one of the many conversion websites. However, this particular piece of code uses the Yield keyword; and I don't know how to work around that. [Code]

View 10 Replies

VS 2010 Alternative AppActivate Code?

Oct 28, 2009

the name pretty much says it all, I need a more reliable code then AppActivate that does the same thing. I need it to activate a program I tell it to, perferribly without calling the process id.

View 6 Replies

VS 2010 Alternative Method Sqlcompact?

Sep 19, 2011

What would be an cleaner alternative for a code like this.

Dim dAdapter As New SqlCeDataAdapter dAdapter = New SqlCeDataAdapter("SELECT name FROM Users WHERE username='" & GlobalVars.user & "' AND category = '1'", ConnectionString)

[Code]...

View 3 Replies

Has Microsoft VB 2010 Express Got An Alternative To MicrosoftReportViewer

May 12, 2011

I am Using Visual Basic 2010 Express. And the Express Version Does Not have a MicrosoftReportViewer Facility. But is there an Alternative that can be used. I know Monies have to be made But Surely there should be an alternative For the Microsoft Visual Studio/Basic 2010/2008 Express User.or is there another way to create a reportViewer in Visual Studio/Basic 2010 Express. I have Downloaded the MicrosoftReportViewer Redistributable from

[URL]

and I run the setup but it does not work. I know there are other apps that might help me like crystal report. But I want to just use Microsoft version as it is a Microsoft Program.

View 2 Replies

Use A Structure In Multiple Classes?

Mar 19, 2012

I want to use this Structure in multiple .vb files within my project:

Structure MyStruct
Dim Name As String
Dim Good As Boolean
End Structure

If I define it in one file, the other files can't use it. How do I define it globally?

View 1 Replies

Multiple Combo Box Selection

Jan 7, 2010

I'm new to VB.NET and looking for some help with combo boxes. I was wondering if it is possible to link 2 combo boxes to each other based on user selection? [code]If the user selects Dept Name "Bakery" from the first combo box the second combo box should fill with the appropriate Section Name i.e. "Bread", "Cakes" etc.I am using VS2008 and the DB is SQL Server 2008. Both combo boxes are currently bound to the above Tables and displaying all Dept and Section Names.

View 2 Replies

VS 2010 : Alternative Method For Getting File Type Description?

Nov 15, 2009

I am currently using the registry to get file descriptions for files. As an example, so that a DOCX file will return the description "Microsoft Word". I am doing this from the HKEY_CLASSES_ROOT registry key.However, registry access is extremely slow, and I need to do several thousands of these. Is there an alternative way to do this?

View 6 Replies

VS 2010 Merging Two Forms, Or An Alternative Method To The Topic?

Oct 17, 2011

The only way I can think of to display this moustache is by creating a new form and locking it to a certain point, that all works.My problem is with all the events surrounding this. E.g. minimizing the actual application etc...I know how to handle those in code but that is painstaking as I have to think of every possible event which would result in a problem then manually code for the moustaches relative actions. So, I would like to know:

View 2 Replies

Multiple Datagrids Filtering On Selection?

Mar 22, 2009

this is the wrong forum because I am quite new to this :S and I am actually unsure what this fits under. I am using Visual Studio 2008 windows form in .vb so I am taking a guess at it being Visual Basic 6.0Well the question is this. On a form I have 3 Datagrids. The first one shows information about a case including client name and ID. The second shows a table that contains all the jobs registered to the company by the clients. lient can have up to 8 Jobs. The third is a list of all case numbers that clients have

View 4 Replies

Removing Multiple Selection From List Box?

Mar 19, 2009

How can I remove multiple Item selection from list box ?

Private Sub rf_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles rf.Click
If Not (pb.Image Is Nothing) Then

[code].....

View 1 Replies

How To Manage Multiple Tables With Same Structure (Redux)

Feb 23, 2011

How to manage multiple tables with the same structure. However, due to the craptastical nature of VB, the solution doesn't really work. It specifically doesn't work because VB.NET requires the implementation of each method/property in the interface to be explicitly declared.

As for the problem that I'm really trying to solve, here it is:
I have many lookup/domain tables in the database that all have the same structure.
The items in these tables are typically used for drop downs in the interface.
I would like to avoid a bunch of boilerplate repository methods to retrieve the contents of these tables (one method per table really sucks when you have 40 tables).
I am not using the One True Lookup Table anti-pattern and this is not an option.

View 2 Replies

Structure Values Change In Multiple Places?

Mar 21, 2009

I have created two structures, one named "Product" and the other named "Item". These structures are quite similar but are at the same time quite different from each other. The structure definitions are as follows. Ultimately, I declare arrays in my containing class which access these structures as a type. Their declaration: "Products() as Product" and "Items() as Item". All has been fine and dandy until one day, I go to change the items Enabled() values, and something happens. Not only does it change the Items(index).Enabled(index) value, it does it on the corresponding Products(index).Enabled(index) value, even though it was never specified to do so. Also, nowhere in my coding have i defined this sort of thing to occur. It is rediculous, because I watch it happen. I turn on the watch window, and debug one step at a time, and every time, I watch the Item line step, I look down at the arrays of products and items, and both values have changed. How do I get this to stop, and only change the Item.Enable value??

<Serializable()> _
Public Structure Product
Public Name As String

[code]......

View 2 Replies

Does Microsoft Access Allow Multiple Checkbox Selection?

May 22, 2009

where I want to use the Select All and Deselect All CheckBox. There is no Visual Studio installed there. They want everything in Access. Visual Basic is not installed, it is within the Access interface. Is there a way I can use VB code to have a Select All and Deselect All option. I dont want any code. Just want to know if it is possib

View 1 Replies

Multiple Selection On A Checkboxlist To Filter A Datatable .net?

Feb 27, 2012

I have a datatable loaded from a database. I bind the datatable to a gridview on page_load. Now I want to filter the gridview by a user selection so I made a checkboxlist and wrote some code as follow at CheckBoxList1_SelectedIndexChanged

[Code]...

With this code above, it can filter if there is only one selection on the checkboxlist. I try to loop the checkboxlist myself but always ended up in errors. Hope someone can help me out to make this work.

View 1 Replies

Update Table From Multiple Grid Selection?

May 1, 2009

I need to update a link Table with the data I select from multiple grids, the problem is only the last command statement takes effect, therefore I am only updating the link table from the last command statement, is there a way to update the link table with all the command statements?

Dim ConnectionString As String = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|aop29.mdb"
Dim objConnection As New OleDb.OleDbConnection(ConnectionString)

[Code].....

View 4 Replies

Sorting List (Of Structure) - Sort Multiple Variables

Feb 17, 2011

I'm using a Listview in VirtualMode, so I can 'add' a lot of files almost instantly. A Listview in VirtualMode does not allow sorting, so I need to sort the data myself. The data is stored as a List of Structure (it's faster to load than a List of ListViewItem). The code below works fine, but I need to sort based on multiple variables in the Structure. Code:

View 2 Replies

Using A Structure Array With Multiple Member Names With 2 Types?

Nov 2, 2009

I am using a structure array with multiple member names with 2 types. My question is can you single out one of the member names and add its total? kinda like this...

HTML Code:
structure structureName
dim a as string
dim b as double
dim c as double

[code].....

View 2 Replies

DataGridView Multiple Row Selection, Specific Column Data Get?

Apr 23, 2012

So I have a datagridview being populated with data from a database.At this point a user may or may not selected (via mouse click / key press) one or more rows within the datagridview.I need to (upon selection) create a new dataset, datatable and add rows with the some data from the said datagridview.

For example, if a table had nothing but names, e.g.

Joe
Sean
Larry
Chris

Upon the user clicking, dragging a selection over Sean and Larry to add those names to a new dataset so I can pass it to another method for further processing.

[Code]...

Input array is longer than the number of columns in this table.It looks like I'm either missing a column declaration or adding the table to the set?

View 1 Replies

Forms :: Multiple Selection ListBox Click Order?

Mar 4, 2009

How would I display list items from multiple selection listbox in order they are clicked?

View 4 Replies

Having A Selection Of Code Once To Use Multiple Times In Differnet Places

Jun 8, 2011

I know that title is kinda miss leading, but i couldnt figure out another way to explain it. I know theres a way, but I dont know how to do it.Ive got a Save code that I have about 5 differnet times in my application. How do I make it so that I can just type in something like Do Save, and it locates the save code and follows it through, then returns to where it was.

View 3 Replies

Multiple ListBox Items Selection - Quantity Design

Oct 3, 2011

I have a listbox that allows a user to have multiple selection and a button to transfer these selected items to another listbox, now theres a new requirement which I also need to indicate the quantity for each respective items. I currently have a Source items select box and a Selected items select box. how to go about designing this feature?

Multiple select box selected Quantity
E.g. Eggs ---> Eggs ---> X 4
Vegetables Potato X 5
Potato

View 1 Replies

Selection Of Multiple Folders At A Time / Scrollbar Position?

Jun 1, 2010

A couple of questions about the FolderBrowserDialog in VB .NET Express 2005...
1. How can I make it so this control allows selection of multiple folders at a time?
2. It remembers the folder I selected last time (in the same session), and highlights that folder, which is good, but that selected folder appears near the bottom of the window. Is there a way to make it so the previously selected folder appears in the middle of the window (i.e. the scroll bar is further down the window)? See screen shot attached for how it currently looks when the window opens.

View 2 Replies

Winforms - Error - CheckedListBox Is Not Compatible With Multiple Selection

Apr 16, 2010

I have a little problem with a little VB.NET application that I am building. This is a winforms applications not WPF.I have a checkedlistbox with a few items and I want to allow user to select more than one using arrows keys or mouse clicks combined with shift and ctrl keys so I set selectionMode property to multiExtended. In design time it is not possible I get an error: It says value property is not valid.and if I set it in runtime by doing:

clbEmployees.SelectionMode = SelectionMode.MultiSimple

I get an error too: It says CheckedListBox is not compatible with multiple selection.

View 1 Replies

Multiple Record Selection In Grid View And Batch Processing?

Sep 1, 2009

I would like to know how to select multiple records from a gridview, (ie checkboxes in itemtemplate) and process SQL statements on the records. So in short, its basically selecting records from a grid view by ticking the check boxes, and clicking a process button which then proceeds to execute the SQL statements corresponding to the records selected.[URL]..

View 1 Replies

VS 2010 - Form - MoveWindow API Alternative - Resize & Move A Form Using VB Commands

Mar 22, 2012

What is the best way to resize & move a form using just VB commands? I have a form that I need to set the Height and Top props, problem is that takes two calls and there is a noticable flicker. I tried using SuspendLayout/ResumeLayout, DoubleBuffered, swaping the top and height calls around, etc, but nothing seems to help. The test forms only have one small listview and one or two buttons. [Code]

View 2 Replies

VS 2010 Deserialisation Of An XML Structure?

Mar 31, 2010

I'm making some cataloging software that will catalog all the items in our shop, and I'm saving the data [structure] as an XML file through the following code.However, I'm not sure as to how to convert it back to a structure.

[Code]...

View 7 Replies

VS 2010 Get 23 As The Size Of This Structure?

Apr 18, 2012

I have this structure:

<StructLayout(LayoutKind.Sequential)>
Public Structure ContFileHeader
Public MagicID As UInteger ' 4 bytes

[code]....

Why then:

Dim header As New ContFileHeader
Debug.WriteLine(Marshal.SizeOf(ContFileHeader))

gives me 32 ? Is there a way go get 23 as the size of this structure?

View 17 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved