Use Switch Cases In Calculator?
Mar 7, 2011Private Sub cmdCalculate_Click()
Dim Run As Double
Dim Rise As Double
[Code]....
Private Sub cmdCalculate_Click()
Dim Run As Double
Dim Rise As Double
[Code]....
I have been programming for alot of time. Generally i program in some languages like PHP, ASP.net, Java, JavaScript and others. In all languages i have to use alot of if else statments . Like if value= 10 then ... if i review my code then i find alot of if conditions. So i would like to minimise them but how not sure. one point was using classes somewhat minimised but still they are more... like task, cat, sec and type:
[Code]...
I am trying to calculate from a case, and it does not seem to work, and I also need to validate when no input is entered and the person presses the calculate button. my code is a follows
Public Class Question2
Dim intSal, intCount As Single
Dim intPiece, intRates, intPay As Long
[code].....
I was so happy when I discovered IsLittleEndian field in BitConverter. I thought of course it should be there and I should be able to specify whatever endian I like. Well, my happiness didn't last long. Spent some time till found out that there is no way to set the field.The field is readonly, and it is only set to true in static constructor:
[Code]...
My question is: how come there is very useful piece of code that is already implemented and sitting there in the FCL, but there is no way to use it (unless you start messing with reflection of course)? Is it just because some developers didn't meet the deadline and left the job half-done? Even if so, why the code is not available, but the field is?I hope there is a good reason for this.
I want to make myself clear. I don't need a solution on how to handle big-endian values. I do have a solution. The solution is actually shown in my question.
I have a DataGridView and one column has DataGridViewCheckBoxColumn type .The datagrid loads from selected items of a listbox.I need to hide Check box cell in this grid according to the item. It means some items should not have checkbox in that cell(I have the list of those items which should not have checkbox in that cell).
View 3 RepliesThis LINQ to SQL query From g In Db.Context.Current.Groups Select g.GroupID
generates this SQL:
SELECT [t0].[GroupID] FROM [dbo].[Groups] AS [t0]But this query From g In Db.Context.Current.Groups
Select g.GroupID, g.MemberCount
[Code]...
I very much want to select only the fields I need. How can I persuade LINQ to SQL not to select all columns?
I can't remember very well the instances where my selected items has disappeared as if I did a "Reset ToolBox", the last time I remember was when I installed the Service Pack early this year. But last year I think it has been reset frequently and I find it bothersome to reselect all those items again and again.Is there any configuration that I could set so that my selected items are safeguarded, that is they won't be removed no matter what?
View 4 RepliesI'd like to select my cases from an external location.[code]I want my users, when they click a button, to download a file from my Dropbox(a .txt file). Then, the file will read all of the code, and add it to the code..So for example if in the .txt it was something like.[code]
View 3 Replieswhat exactly the difference between using cases and if statements are.
View 4 RepliesI am having trouble figuring out what I need to do in order to get the program to drop into the different cases. I am suppose to be doing a case block for this assignment. I believe everything else is good but it always outputs the first case and doesn't progress down depending on the inputs. I tried to number them case 1, case 2, etc.. Here is the code
[Code]...
I have an access table and I want to write a query that has a case in it, but it gives me an error message when running the query Error "Syntax Error missing operator in query expression"
[Code]...
Im trying to to detect what is in the string and so something for each different result but im not sure howto, here was my first idea but it obviously doesnt work as you cant use contains that way:
Select Case omg.Contains
Case "1"
MsgBox("1")
Case "2"
MsgBox("2")
End Select
I am working with cases, I'm only learning it so far, but just can't get a drop down menu to work that would change the background of a Textbox.
Private Sub cbColours_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cbColours.SelectedIndexChanged
Select Case colours
Case Is = "Red"
txtSpace.BackColor = Color.Red
[Code] .....
It isn't doing anything at all...
In the dropdown menu, it has
Red, Blue and Green one per line
When the value (e.g. Green) is clicked, it will then change the Textbox to the colour selected.
Formatting the input text to upper and lower cases e.g Start with a capital.
View 8 RepliesIs there a way to make a VB case statement evaluate all the cases? Similar to a java switch statement (without the break).
View 5 RepliesI'm using the following code to read values, from a parallel port. Can I check for multiple cases by using 'and'? [Code]
View 10 RepliesWhat purpose do protected or private (non-static) events in .NET really serve?It seems like any private or protected event is more easily handled via a virtual method. I can (somewhat) see the need for this in static events, but not for normal events. Have you had a use case before that clearly demonstrates a need or advantage for a non-static protected or private event?
View 5 Replieshow to switch between VB.NET and C#. I need this information because I have a project that needs application building and the programming language is C#.I found a good sample program on the Internet which uses an SDK called Ozeki SIP SDK.
View 1 RepliesThis is my vb.net code:
[Code]...
Exact duplicate: How to switch a large app from VB6 to VB.Net Exact duplicate: Best strategy for moving applications from VB6 to VB.Net Exact duplicate: Conversion tool comparisons for VB6 tool which converts vb6 to vb.net
View 5 RepliesI am using Visual Studio 2010. I have a Splash Screen which starts first (Everything is running smoothly there). Then it Opens Dialog1. My user is required to check 5 boxes (2,3,4,5,6) (1 has been deleted). I used this Code :
If
CheckBox2.Checked
And
CheckBox3.Checked And
[code].....
I've been experimenting for an 1 hour. The code didn't show errors. I tested it and it didn't work. Then I found out that I was working on Dialog 2 in Dialog 1 code. So I tried another thing and that didn't work because I can't put Dialog2 code in Dialog1 code.
I have two machines, on the first of which I have developed my application to a point of satisfactory stability. Now I want to move everything to my second machine.Both computers have the same level of XP and NET Framework code, and both have Visual Studio 2010 at the same level.I copied my application's project folder onto the second machine, but the second machine's VS 10 can't load the project because it can't find a couple of Interop files (e.g., AxMSComCtl2). All of files are present in the project folder and also in its.bin subfolder. The only observable difference between the two machines is the presence, on the first machine, of some Assemblies stored under my user name there. Copying the Assemblies to the second machine didn't help (I hadn't thought it would).Is my application permanently "imprinted" on my first computer, or is there a simple way of resusitating its clone?
View 10 RepliesHow to switch from users A to user B in visual basic? User A should not log off.
View 3 RepliesI always get an exception when I try to switch between different forms in my program. Here is the exception message:
Control.Invoke must be used to interact with controls created on a separate thread
I have attached the forms to very nice variables and this problem occurs when I try to use command like MyForm.Show().
It does not happen when the forms are not attached to variables, but then I have collosal problems with refreshing the textboxes and stuff.
edit;
I have 4 different forms. When I load the main module and main form, in the Sub (...) Handles MyBase.Load I execute the following code:
In module:
Public StartupForm As frmStartup
Public RegularForm As frmRegularUse
Public LoginForm As frmLogin
[Code]....
This is the aproach I worked out to get the full control over refreshing the forms. It is a program for Motorola Scanner with Windows CE. Now, for example, when I enter the correct password in LoginForm, I want to switch to the RegularForm. When I try to use RegularForm.Show() or RegularForm.ShowDialog or RegularForm.BringToFront(), I get an exception. When I try to call the form with the frmRegularUse.Show() I can call the form, but it is being created in a different thread, I believe, so I loose control over it (when I try to put something from the keyboard, there is no response).
I'm creating a wizard kind of Windows Application. I've to show up the next window on click on "Next >" of every window.
FYI, I cannot use MDI architecture.
What is the best way to achive that?
Right now, I've put the following code on Next Click of every Window.
FormNext.Show()
Me.Hide()
I have some code for my DGV Cell painting event:
'Private Sub DataGridView1_CellPainting(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellPaintingEventArgs) Handles DataGridView1.CellPainting
' If e.ColumnIndex <> 1 Then Exit Sub
[code].....
VB.NET is good for me, because it is simple and its not complicated and you don't need to be so strict with syntax. I want to switch to C# but I just don't feel up to it because of the syntax and C# being so strict. What are some good reasons to switch to C# and what will make the transition easier?
View 7 RepliesI have a .NET application that was written in C# and VB.NET using WinForms. We want to slowly migrate this to something new, in many iterations. The new code will be entirely C# and WPF. We would like to utilize Prism.
As far as I know, we can't integrate the old WinForm app in Prism.
I am considering making my old app show the new app in certain instances. For example, when you press a tab in the old app, the new app opens on top of the old app, with the same tabs. Over time, only the new app would be necessary.
I have downloaded SP1 and installed it,I have an applciation with 10 form and numerous classes and dialogs. When I right click a form in the soultion Explorer window and choose view Designer VS hangs for anything upto 10 mins. Is there anything that I can disable/ enable to stop this hapening. The only Language that I will be developing in is vb.net.
View 10 RepliesHow to switch between form in runtime
View 5 Replies