Program To Deal With Sine/cosine Functions?

Jun 2, 2009

I am making a program to deal with sine/cosine functions

If rdbsideA.Checked = True Then
Do While AngleB > 0
SideA = (SideB * Math.Sin(txtAngleA.Text)) / Math.Sin(AngleB)
MsgBox("The Length of Side A is ", SideA)
End If

That is if the user seleects to find side a. When the messagebox pops up, it doesnt state the previous calculation, why is that?


VS 2010 Shuffle Up And Deal Program Would Like Advice?

Nov 10, 2011

I have handed this assignment in and it works albeit not in the most elegant way. I am taking my second programming class ever and I would love for some feedback and answers to a few questions i have. First, what would be a better way to display the correct image to the corresponding card. Using all those if statements seems ridiculous, but i cant see a way around having card 1 possibly equal each value from every suit, card 2 equal each value from every suit, etc.

Second, my professor wants us to be able to record the seed value so that we could then plug it back in and return the hand that was shown when it was created. i have done this but I am a bit confused. The seed shows up as a value from 0-999, but when you use the combination formula to figure the total possible amount of hands you get over 2.5 million. Since i only have 1000 seed values does that mean that multiple hands might share the same seed value or does that number (0-999) mean something different eache time? Sorry if my explaination seems confusing.

Third, I am always looking for advice on better ways to do things. If anyone has free time and would like to offer constructive critisism I would be grateful.Below is the code. I only left in picturebox display for 1 suit so as to shorten the total amount shown. I also removed code for other buttons and stuff.

Public Class Form1
Private Sub btnShuffle_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnShuffle.Click
' Variable Declarations
Dim intSuit As Integer ' Row
Dim intCardValue As Integer ' Column


View 4 Replies View Related

Create A Sine Wave Generator?

Feb 3, 2009

how to create a sine wave generator in

View 2 Replies View Related

Sine Wave Sound Generator

Jan 25, 2011

Could someone describe the way by which i could generate a sine wave sound with a certain frequency?

View 5 Replies View Related

Sine Wave Using Timer Component?

Feb 28, 2011

[URL]..I wrote a program with a timer set to tick every 100 ms. The values oscillate between 109 and 110 ms. Each tick, a variable adds +1 to itself; it starts at 0 and goes to 9 and then it goes back to 0 where it continues the addition process. When the timer ticks 110, the variables is added to a textbox. The pattern is something like this, which you can see in the above youtube video. 5 9 5 9 5 9 4 8 4 8 4 8 3 7 3 7 3 7 etc.


View 4 Replies View Related

Write A Simple Sine Graph?

Mar 21, 2011

How to write a simple sin graph for my calculator? I need , when I'll press the button, to show this graphic.

Private Sub btnsin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsin.Click
For i = 0 To 100


View 7 Replies View Related

VS 2008 : Have A Class Where The Functions Of The Same Name Are Both Instance Functions And Shared Functions?

Dec 6, 2010

What I am trying to do is have a class where the functions of the same name are both instance functions and shared functions.

Public Shared Function Get...(byval xx as xx)


Public Function Get...

The Public Function uses a Property xx created in the constructor, whereas the Shared Function has the parameters (byval xx as xx).

View 1 Replies View Related

Use Friend Functions In Program?

Jun 1, 2010

As far as c/c++ is concerned ,friend functions are defined outside the classes and they are accessed without object name.But in how can i create friend functions like that ? Is the concept samehereor its bit different than whatwas in c/c++ ?

View 11 Replies View Related

VS 2008 - Program With Functions Only

Mar 3, 2010

I was curious if anyone has heard of writing a program with functions only. It is part of my current assignment but all the examples I have seen all over have at least subs for the click events. SO I am a little confused to say the least.

View 3 Replies View Related

Right Click Over A Textbox And Add Some Functions To The Program?

Mar 18, 2009

what event do I add to right click over a textbox and add a function to and options list...

View 1 Replies View Related

Use Left , Right And Mid Functions In Program 2008?

Mar 1, 2009

How to use the Left, Right and Mid functions in VB 2008?

View 3 Replies View Related

Hooking Another Program's Calls To Winapi Functions ?

Oct 22, 2010

I have been trying to build a game bot in of the main problems is getting access to the text the game prints on the screen so I have been trying to hook the games calls to the windows api drawtext and textout functions.I have been hunting for examples of how to set up a hook in for a long time without any luck.I have found it impossible to translate examples in old school vb, C++, and C#.For convenience's sake I would like to use the freely available deviare and/or easyhook libraries.

View 2 Replies View Related

Launch Program Functions With Administrative Privileges?

Sep 22, 2011

how to elevate privileges when my program executes code through command prompt. My program will already prompt for administrator access when it is launched. This is the code from my manifest file that will allow it to prompt for UAC admin permissions/credentials (to elevate permissions)

VB .Net 2010

<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="">


View 5 Replies View Related

Write Some Functions To Stop From Having To Use The Same Code Over And Over In Program

Feb 13, 2010

I have a program and the program works fine. The only thing is that I want to shorten it up and stop using the same code over and over. I use the same redudant code through out the code. I want to write some functions in order to stop from having to use the same code over and over in my program. I wanted to know if someone could help me with functions: Here is part of my code below.


View 3 Replies View Related

Program Using Arrays And Functions - Highest / Lowest Number

Jun 14, 2012

I am new to using VB2010 (and coding in general). Also brand new to these forums . Okay so I am making a program that: allows the user enter the number of customers served for each of 12 months into an array. The application should calculate and display the following statistics: total number of customers for the year, the average monthly number of customers, and the months with the highest and lowest numbers of customers. Use inputBox to get user input. Do not accept non-numeric or negative numbers.

The problem that I am having is that I do not know how to display which was the best and worst month. I imagine I need something that targets the highest/lowest number and finds the text in the corresponding index but I'm not sure how to do this.

View 2 Replies View Related

Use DirectX Audio Functions In Program For WinXP / Vista?

Apr 9, 2012

I've been fighting for weeks now to make a simple music playback program. It would function much like Windows Media Player without the visualisations and playlists. I'm writing this on a Win7 box, but it needs to work on XP and newer.

I say fighting because I'm severely annoyed at how MS has worked some items and it's taken many days to go through everything only to find that it doesn't work.

I started by using WMP in VB Express 2010 and having it play my music. Simple, but not portable. I copied my .exe to a WinXP machine and it blew up. I copied it to a different Win7 machine and it doesn't run (I can double-slick all day, nothing happens,
no log entries, nothing....)

Then I find that there is an issue with the GUID of media player on different computers, and it'll most likely fail to run when you try to use it on other machines than the one the program was built on.

So I gave up on that.

I then figured I'd use DirectX. It's on XP and newer already, and is supposed to be backwards compatibile so if I build my app on Win7 it should still run on XP and such. I did that, and it works fine on the machine I built it with (again). My shuffle works,loop/repeat works, got my own version of a playlist and it all works. I copy that to another Win7 box and it doesn't run at all. It's setup as .NET 3 so I can be sure of compatibilty with WinXP.

For grins, I gutted all the code in my VB app involving calls to Directx and built that. It runs fine on other computers, including my XP test box. So I know the problem revolves around DirectX somehow.[code]...

View 10 Replies View Related

VB - Functions Of Word 2007 (in Vista 32) Hanged The Program

Mar 11, 2010

Suddenly some functions of Word 2007 (in Vista 32) hanged the program, such as Help or Search/Replace. When Word is reopen a message appears: microsoft visual basic. File not found. How can I solve this? I have uninstalled/reinstalled Word twice, but nothing happens.

View 1 Replies View Related

Get Results From GenerateNumbers Outputted To The Main Program To Be Used In Other Functions/procedures?

Dec 10, 2011

I'm having trouble getting this program to work.. I just cant figure out how to get results from GenerateNumbers outputted to the main program to be used in other functions/procedures.I tried

Dim Result1 As String = ThreeResults(0)
Dim Result2 As String = ThreeResults(1)
Dim Result3 As String = ThreeResults(2)

but for some reason it sets the value of each ThreeResults(x) to " "[code]......

View 1 Replies View Related

Operate Functions Based Off Of Hotkeys - Hit Escape At Any Time And End The Program?

Oct 14, 2009

I have a program that I need to operate functions based off of hotkeys.One of the most important things I need to be able to do, is hit Escape at any time and end the program.Remember, the program form will not be up, it will be a number of any other applications, I need like a global hotkey or something.

View 3 Replies View Related

Unit Test Private Functions From A Separate Project In Program?

Mar 15, 2009

As I develop code, I often want to unit test some of the building blocks of a class even if they are normally private. If my unit tests are inside the project, I can use "Friend" to accomplish this and still keep the functions private for normal use. But I would rather move my NUnit tests into their own separate project(s).

View 3 Replies View Related

CNC Control Program, Based On A DLL - Acces All Functions By Means Of Softkeys ( F-Keys At Top Of Our Keyboards )

Apr 8, 2009

I'm working on a CNC control program, based on a DLL that someone else wrote. No problems with that sofar, as i get good support from the writer.

The problem i do have to tackle is the following: I want to acces all the functions by means of softkeys ( the F-Keys at the top of our keyboards ) when the program starts it shows the Main menu softkeys ( F1-F12), and each F-key has a function assigned to it, some will make the machine move, others will show another menu, or a fileopen/save dialog, depending on the chosen keys.

All works fine and handy-dandy, except for the F10 key, it seems to be "Sticky", when i press it, the program will not react to any other key, only the F10 key can get it back in "normal state" accepting every key with a function assigned..

How to "unstick" the F10 after pressing it?.. because pressing F10 now, means no other key will do anything, and that may become dangerous, when the machine is moving and it must be stopped..

View 11 Replies View Related

Forms :: Random Functions - When Start Program And Click Picturebox - Same Card Will Always Come Visible

Mar 30, 2011

Okay, so I'm doing a card game and I'm trying to set that when picturebox (PictureBox1) is clicked, a random card from 13 cards will come visible. Problem is, that when i start the program and click the picturebox, the same card will always come visible. As you can see i've put a button (Button1) which will hide every card. If I press Button2, then Button1 and then the PictureBox1 it will show differend card, but the cards which come visible are always the same.

e.g i press PictureBox1 (which will make card visible), then Button1 (which will make PictureBox1 non-enabled) and then Button2 (which will hide every card and make PictureBox1 pressable). Lets say i pressed the PictureBox1 four times and i got cards: 9, 6, 7, 3, then I close the program, start it again and press PictureBox1 again 4 times and it will show the same cards (9, 6, 7, 3). How can this be done that it will not show the same cards always?

Here's my code...
Public Class Form1

Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click


View 3 Replies View Related

VS 2005 : Make Program To Select A File, Create DataTables And Then Perform Some Other Functions?

Feb 9, 2011

I am attempting to have my program select a file, create DataTables and then perform some other functions. I want to be able to open another file and re-do the same steps.The problem I am having is that I add columns to my Datatables and when I try and to open another file while one is already open I get a message that a column of xyz is already added how do I properly "clear my datatable" or perhaps that isnt even the correct approach? Here is the code I have that Opens a File

Private Sub OpenToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles OpenToolStripMenuItem.Click


This was working at one time but after adding to my project I must have placed something in the wrong place inadvertantly or it has soemthing to do with adding columns,?

View 4 Replies View Related

Excel Maths Functions And Calls To All DLL Functions Documentation?

Jan 29, 2007

1)Is it possible to access the Excelmathematical functions without actually opening Excel?

I was thinking ofthrough a DLL WinAPI call or maybe a delegate function or smaller program?

2) Does anyone know of a MS link or area that gives instruction on "how to" use every function of every Windows DLL at all?

Or for all those that Microsoft have chosen to document online at least.

View 1 Replies View Related

How To Deal SQL With Apostrophe(')

Aug 17, 2011

I am using VB 2005 and MS Access 2007.Some of business name has apostrophe(') and I need to know how SQL deal with this name.For example

sqlStr = "SELECT * FROM AddressTable WHERE BusinessName=" & "'" & updateBName & "'"
in this case, if updateBName is "Den's Nail", the real SQL is
"SELECT * FROM AddressChangeTable WHERE BusinessName='Den's Nail'"

and this code generates Error Message.Is there any way to prevent error ?Or do I have to remove all apostrophe(') in Business Name?

View 3 Replies View Related

Deal With Attachment Fields Using .NET?

Aug 1, 2010

how to deal with attachment fields using VB.NET?

View 3 Replies View Related

How To Deal With Multiple Records ADO

Feb 28, 2010

I have following data in my table:

slno Name Age City
1 Ron 22 Dallas
2 Jonny 26 Texas

Now i use the following method to access data:

Using connection As New SqlConnection("Data Source=.SQLEXPRESS;AttachDbFilename=E:Visual Studio 2008ProjectsSmart SyncronixSmart SyncronixSmartDB.mdf;Integrated Security=True;User Instance=True")


View 1 Replies View Related

How To Deal With Tabs In A Tabcontrol

Jul 27, 2011

TabControl1. It is the only control that is created in design time. My text editor is a tabbed program. I have a addtab() function that whenever teh user clicks the toolstrip addtab, the tabcontrol adds tabs. THe code below is for the addtab()

Private Sub AddTab(Optional ByVal file As String = Nothing)
NewRTB.AllowDrop = True
NewTab.AllowDrop = True


View 2 Replies View Related

How We Use List To Deal With Attribute

Sep 1, 2010

how i can but the attributes that exist in web page in list and what are the differences between arraylist and list in

View 4 Replies View Related

Clean Up App And Deal With The Async Calls?

Mar 16, 2010

My app is basically talking to a device via RS232. I need to 'listen' to the data received and do certain things based on it, update labels, etc. When I started, I only had a couple cross-thread calls and I used JMC's example to get by that. Now my app is bigger and I am calling the ThreadProcSafe all the time. I am hoping there is an easier way so I don't have to create sub routines for every control. Here's the relevant parts of my code.

Private Sub StepperSerialPort_DataReceived(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs) Handles StepperSerialPort.DataReceived
Dim ReceiveBuffer As String


View 4 Replies View Related

Deal With Someone's Ugly Code Gently?

Jul 7, 2010

I've recently been given the task of finishing an incomplete project for my University. It'll count as credit for one Class so I'll shave a month off of my studies!


Methods returning numbers just for the hell of it, passwords being saved in plaintext, you name it.

I have a meeting with the original author and I don't know how to handle this situation because I'm quite green in this area. How can I tactfully mention that I want to rewrite the whole thing?

View 12 Replies View Related

How To Deal With Index Out Of Range Exception

Feb 1, 2011

I was trying to add two quantities at different rows of same description i.e same product_name and same item_pack.1st I want to check the table if it contains the same description or not by comparing with the first record and so on. When found, I'll add up the quantities and then to delete that particular row (to avoid duplicate search). But when I delete the row the particular row, next time it throws an out of index exception

View 2 Replies View Related

Html - How To Deal With Special Characters In .NET

Jul 20, 2011

I've received a text file in which the text is like this, ãYAHOO.COM. When I'm debugging in Visual Studio, the value I see for the character is "�"c. Firstly can anyone tell what is the character before yahoo. Is it a special character or some html character, and what is the character that I'm seeing in VS while debugging.So it goes like this, the ascii value of the character turns out to be 63.But when I write the value to a file it generates 3 characters whose ascii values are above 127.

View 3 Replies View Related

Random Playing Cards Deal?

Nov 4, 2010

I am creating a VB.Net program to deal out five random playing cards.For that purpose i checked the following tutorial - [URL]..It works great. But It has too much functionality I just want to get rid of the unwanted code to just dealing out 5 random cards. functions and classes from thius program that I should use.

View 2 Replies View Related

Using Textbox To Deal With String More Efficiently?

Feb 23, 2009

I've been trying to improve the efficiency of my giant program and I know that using a textbox to deal with a string is terribly inefficient.
Function CollectionSplit(ByVal TheString As String, ByVal TheSeperator As String)
Dim tb As New TextBox
tb.Text = TheString.Replace(TheSeperator, Environment.NewLine)
Dim returnable As New Collection
For Each x As String In tb.Lines
If Not x.Length = 0 Then returnable.Add(x)
Return returnable
End Function
What it does is convert a string of "1,2,3" into a collection of the 3 separate items for use later on.

View 1 Replies View Related

VS 2008 Best Way To Deal With Pre-defined Logins

Aug 28, 2009


I got an Error about the INSERT INTO statement at command.executenonquery, but Im not seeing it. Could it be something else?

View 5 Replies View Related

.net - Deal With Output From A Secondary Process In Realtime?

Apr 27, 2012

I am trying to write a VB .NET program that runs a Perl script and reads and uses the standard output. I'd like to be able to handle each line separately as it is printed, and update my program display accordingly. Here's some code I have "written" (read: "mostly copied off the internet"):

Private WithEvents pscript As Process
Private Sub myProgram_Load(sender As Object, e As System.EventArgs) Handles Me.Load
pscript = New Process()


This works with one problem: the program waits until the test script has run to completion, and then fires several OutputDataReceived events one after the other. This means that when I make it use the real script, it's likely to do nothing for as much as several hours, and then have to deal with, like, 5,000 events at once, despite the fact that stuff was being printed at fairly regular intervals throughout that time.

Is there any way I can make it deal with each line of text when it is written, instead of all of it at once at the end?

View 2 Replies View Related

Cleanly Deal With Different Behavior Based On Polymorphism?

Mar 24, 2011

Suppose I have an interface IFoo with implementation classes VideoFoo, AudioFoo, and TextFoo. Suppose further that I cannot modify any of that code. Suppose that I would then like to write a function that acts differently based on the runtime type of IFoo, such as


Then I have to do my "If TypeOf ... Is" again. How can I refactor this to take advantage of the polymorphism of the implementations of IFoo without manually checking the types? (in VB.NET, though my question applies to C# too)

View 3 Replies View Related

Deal With Adobe InDesign Files In .Net 2008?

Apr 6, 2010

How to deal with Adobe InDesign filesin VB.Net 2008 such as searching for text or insert a picture?

View 1 Replies View Related

Deal With Incredibly Long (large) Numbers In .net?

Nov 27, 2010

How is it possible to deal with incredibly long (large) numbers in am working on Problem 25 in Project Euler, and my program cannot handle these computations.Is there a data type that can handle thousands of digits?

View 3 Replies View Related

Copyrights 2005-15, All rights reserved