VS 2008 - (Shared Class) Select Case

Dec 5, 2009

Im trying to get pass len from a shared class but when i call it. I used a case to select how long the pass len is but it doesnt select any case.

class name : PassLenCL

Public Shared Function PassLen(ByVal PassTxt As String)

Dim TextLen As Integer = PassTxt.Length

[CODE]...

View 3 Replies


ADVERTISEMENT

Select Case Shared Function?

Mar 29, 2010

xplain to me or give me an example of using a select case in a shared function

View 2 Replies

VS 2008 - Select Case Not Catching The Case

Oct 20, 2009

here is my code..

[Code]....

If the result is 86 and it's mod by 43 the answer is 2 Case 2 is not firing. it just goes to the end of the procedure.

View 4 Replies

Use Derived Class Shared Variables In Shared Methods Of Base Class?

Jun 4, 2010

I am trying to add shared members in derived classes and use that values in base classes...

I have base

class DBLayer
public shared function GetDetail(byval UIN as integer)
dim StrSql = string.format("select * from {0} where uin = {1}", tablename, uin)
end function
end class

[Code]..

currently there is error using the tablename variable of derived class in base class but i want to use it i dun know other techniques if other solutions are better then u can post it or u can say how can i make it work? confused...

View 2 Replies

VS 2008 : Using Select Case With Combobox?

Oct 14, 2009

How would I get select case to work with combobox? So lets say I have 3 items,

Choice 1
Choice 2
Choice 3

How would I use select case to execute code when a certain item is selected?

View 1 Replies

VS 2008 If Else Convert To Select Case

Jan 23, 2012

[Code]....

convert this if-else-then statement to select case.

View 3 Replies

VS 2008 Select Case And GetAsyncKeyState

Dec 29, 2009

How would I use Select Case with GetAsyncKeyState? Ive tried Select Case GetAsyncKeyState End Select and I get Argument not specified for parameter 'vKey' of 'Declare Ansi Function GetAsyncKeyState Lib "user32"(vKey As Long) As Integer'.

View 2 Replies

[2008] Select Case Statement?

Dec 10, 2007

what is the propert way to use Case statement for;When user click on a button it will show different picture everytime.I do not want a random generator. Just show pictures in order

View 10 Replies

VS 2008 Random Text Select Case

Mar 10, 2010

I'm trying to have this WebBrowser1.Document.GetElementById("box").SetAttribute("value", Random)" I want to have a random Text from selection like

[Code]...

View 4 Replies

Using Sender As A Case In Select Case Statement?

Mar 21, 2006

When my form loads it adds some handles (using AddHandler) to a sub (showStatus). What this sub does is checks which control activated the sub (using sender.Equals) and displays text in the status label (status) accordingly.For this I use an If...Then statement for each possibility. There are many possibilities and my code get cluttered. Is there a way to do the same thing with a Select...Case statement. I tried: Select Case sender Case tbOne : status.Text = "blahblahblahblahblahblah" End Selectwhere: tbOne is a textbox, status is a StatusLabelIt gives me an error though, saying "Operator '=' is not defined for types 'Object' and 'System.Windows.Forms.TextBox'."Any ideas on how I can get this to work with a select case statement?

View 13 Replies

VS 2008 Radio Buttons And Select Case Statements

May 26, 2010

how to associate a select case statement with, which point to four Function procedures, to four radio buttons that are used to +, -, *, and / two simple fractions in a fractions calculator. This is a class assignment for which I have already been graded. I used an If...ElseIf statment and it worked perfectly. Now I am trying to utilize the Case Statments with Function Procedures to do the same thing. I do not get graded for this, but I was told to research it an find an answer. My current code is listed below.

[Code]...

View 8 Replies

VS 2008 Select Case Statement For A 2 Dimensional Array?

Aug 20, 2011

I'm in the middle of making a battleship game, and I'm trying to get picture boxes .visible=True based on the coordinates (that have already been given a nice Try/Catch/Finally error handeling block) of the ships. Example: I have picture boxes in a grid formation that are all red, and my naming convention for them is picR00 for the coordinates (0,0), picR01 for the coordinates (0,1)... et al. Because I'm using a(10,10) for my boolean array, I want the stuff thats false (not marked), those coordinates' red picture box to become visible, and the true have the green ones become visible. Here is what i have so far:

Dim a(10, 10) As Boolean, b(10, 10) As Boolean, c As Integer, x As Integer, y As Integer, ox As Integer, oy As Integer
For c = 1 To 3

[Code].....

View 12 Replies

Read Upper And Lower Case Letters Without Having To Put The Upper Case Letters In Select Case Statement

Oct 28, 2009

i have a program using a select case to convert letters to special charaters. My question is how can I get the code to read upper and lower case letters without having to put the upper case letters in my select case statement. Example: Part of my code is

[Code]...

View 6 Replies

VS 2008 - Getting Final Value From Shared Class

Dec 4, 2009

I am having trouble trying to get my shared class final value

Class name : Encryption
Public Shared Sub PassEn(ByVal PassTxt As String)
Dim strText As String = PassTxt
Dim salt As String = "61651616516161651615"
Dim bytHashedData As Byte()
[Code] .....

I am trying to call this from the call and get the return hash but when I try to make a global variable it doesn't allow it. How would I call this and get "HashValue" on to a textbox on my form.

View 4 Replies

VS 2008 - Sub Main In Module Versus Shared Class

Feb 17, 2010

In VB6 I always wrote my apps using Sub Main as the starting point. I see in .NET I'm able to wrap it in a shared class (see [URL] for example). However, the downside is that I can't declare any class-level variables, because of course the class is never instantiated. Being shared, it limits what the code can do. So, any benefit to use a shared class and shared sub main which I'm missing here.

Otherwise it seems using a module (as in VB6) provides a lot more flexibility. Of course, I should also ask if "Application Framework" is really the way to go for real-world apps, or if it's only there for beginners and real-world coders turn it off and use Sub Main instead? If so, how are the events "UnhandledException" and "NetworkAvailabilityChanged" done if App Framework is turned off?

View 28 Replies

Using Treeview To Select One From The Other The Code Contains The Case Select?

Oct 31, 2010

ive got a form containing treeview on the left docked, and two panels one over the other (just as for practice), so i am using treeview to select one from the other the code contains the Case select,

If
Not e.Node
Is
Nothing

[code]....

The problem is , both panels are not visible, when i select the first node the firstpanel is visible then i select the second node both panels are not visible, i return to the first node the first panel is visible.

View 2 Replies

Create A "shared" Variable That Is Shared With All Instances Of A Class?

Jan 14, 2011

I seem to be drawing a blank. I'd like to create a "shared" variable that is shared with all instances of a class but not classes that inherit from it. For example.Class A: Shared list As New List(Of String): list.Add("A")

Class B Inherits A: list.Add("B")Class C Inherits B: list.Add("C")The end result I'd like is that any instance of A has just A in the list. Any instance of B has A and B in the list. Any instance of C has A, B, and C in the list. I can accomplish it by creating Instance variables, but I have to construct the list for each instance of a class. I'd like to construct it once for a specific point in the Hierarchy and then share it accross other instances of that class.

View 12 Replies

Can't Inherit Shared Properties From A Base Class In A Child Class?

Dec 29, 2010

This is another one of my "I think it's not possible but I need confirmation" questions.I have a base class for a bunch of child classes. Right now, this base class has a few common properties the children use, like Name. The base is an abstract class (MustInherit)Technically, this means that everytime a child class is instantiated, it lugs around, in memory, its own copy of Name. The thing is, Name is going to be a fixed value for all instances of a given child. I.e., Child1.Name will return "child_object1", and Child2.Name will return "child_object2".

View 1 Replies

AND / OR In A Select Case

Oct 28, 2010

[code]I don't get any error messages, but the DoSomething() line is never executed. I guess this isn't possible.

View 7 Replies

If-Then-Else Vs Select Case ?

Jan 3, 2011

I'm working on a routine that requires a significant amount of nested and daisy-chained logic. Using If-Then-Else, each logic construct would run 8-15 lines of code (quite readable) while using Select Case each construct doubles that (even with significant commentation, it gets less and less readable with each new Case).

I've read many times in this forum how Select Case is leaps and bounds ahead of If-Then-Else in runtime performance, although I can't recall any discussion of the underlying process(es) that make it so. I've also not had any luck finding good, detailed documentation on the nuts and bolts under each logic construct. What I'm working on, if the performance leap is legit, needs the performance more than the readability but if the performance is marginal then the readability is going to get the priority. how and why Select Case is supposed to process so much faster than If-Then-Else. Links to good white paper would be really nice too.

View 1 Replies

Using Select Case In VBA?

Jun 12, 2011

I have a macro that uses "If Then" to choose what macro to run based on the ActiveCell. I would like to use the Select Case method instead. How would I change this code?

Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
Application.DisplayAlerts = False
Application.ScreenUpdating = False

[Code].....

View 1 Replies

.net - Turning What If Into Select Case?

Apr 11, 2011

Question is, I basically wrote a Rock Paper Scissors game in VB.NET using If statements and wondered how exactly I would try and work this into a Select Case instead.Professor was pretty awful at teaching things and didn't let us know until today that it had to be Select Case(its due tomorrow

View 2 Replies

Converting An IF THAN ELSE Into A Select Case

Apr 3, 2012

Converting an IF THAN ELSE into a select case

View 4 Replies

Converting The Select Case With To And Is To C#?

Nov 30, 2010

I am convertng vb.net to c# 2010 as my job, and none of the automatic tools I have can succeed completely. In special example, this case:

[Code]...

I am mostly java developer before this, so not great with c# and none with vb.net. I do not understand the "oaaaa to" part and this part is not converting. Can you please point me to right place to find the c# version of this?

View 3 Replies

How To Change To Select Case

Aug 26, 2009

I have an if-elseif-then setup as below:
Private Sub CommandButton1_Click()
If OptionButton1.Value = True Then
getdate
Unload glpmenu
[Code] .....
I would like to change to Select Case.

View 3 Replies

New To Vb Select Case Not Working?

Mar 24, 2011

i think this is the right place to post this.so i am doing my First Vb project and have run into some problems

[Code]...

View 7 Replies

Select Case & Combo Box Value?

Jan 26, 2009

I am using visual basic in VS 2008 and trying to learn how to assign a value to a word in a combo box using case select, this is my first attempt at programing and i just can't work out what to do next. So far i have two combo boxes a label and a button, i want the word, first to = 11, second = 9, third =7, fourth = 5. All it is doing at the moment is adding the list index value and displaying that total in the label. I want it to display for eg: if (first=11) and (second=9) are selected a total of 20 in the label,and so on for what ever combination is selected.

[Code]...

View 4 Replies

Select Case Node Key?

Aug 18, 2009

I have assigned nodes in my treeview keys depending on what they are to do with and now i would like to use a select case to choose the right calculation depending on which node is selected.i have tried selecting the key like this:

Select Case tvwFCOM.Nodes.IndexOfKey(tvwFCOM.SelectedNode.Text)
Case Is = "assi06"
Call MinimumSpeeds()

but option strict on dissalows conversion from string to integer. there are more cases, but i have only shown one here. How can i code so that the key is selected from the selected node?

View 6 Replies

Select Case Not Working?

Jan 27, 2010

I had to change the given code from If Then to Select Case, and this is what I came up with. But when I run the program, it does not work and gives me zeroes instead of the correct information.

Public Class MovieInfo
Private wkndBox, screens As Integer
Private title As String

[Code].....

View 4 Replies

Use Select Case Statement?

Jun 3, 2011

I just replaced a different segment of code with the select case statement and it works fine. However I don't understand what the dim is for after you do "Select case [variable name here]"

I currently just dimmed a value as nothing. I didn't specify any data type for my variable I'm using for this case statement. But it works.[code]...

View 4 Replies







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