Make Input Box Function?
Oct 26, 2010Am using An inputbox in my form.If i Press OK the code is fine.When i Press cancel the Program displayin an error. Wat should i Do ?
View 3 RepliesAm using An inputbox in my form.If i Press OK the code is fine.When i Press cancel the Program displayin an error. Wat should i Do ?
View 3 Repliesi want to make a program in which the user can input a mathematical function so the program can then work with it. So the user would input something like x^4+x+2 and then an x and the program would calculate f(x). What i don't know is how to let the user input the function.
View 6 Repliesi wanted to ask how to make picturebox1 ,to which functions are already assigned, perform the same function as picturebox2 ,to which no functions are assigned.For example:I have already made picturebox1 and have assigned it alot of function like when play button is pressed then picturebox1.visible = true and when we press pause button picturebox1.visible = false. So now i decided to make a theme and have to remove the picturebox1 and want to allow the picturebox2 to havefunction of picturebox1.But when i disable the theme the function of picturebox1 should go back to picturebox1.
View 6 RepliesIs there any max/min range of input for the first parameter of FormatNumber() function in VB.NET?As I am sending 99999999999999.99 (which is the maximum limit a column could hold in my sql database) to FormatNumber() it is returning 100,000,000,000,000.00.
View 4 Replieshow to create a function that parses the input from a textinput.Text into an array of named reading, as string, and returns the number of arrays, or perhaps a negative number if there is an error in the input.
i am looking for the answer in vb6 and vb.net.
i had some thing challenging work i had three functions
function1()
function2()
function3()
i had a text box and command button i need to execute the functions when the function name is typed in text box suppose i type function1 and click command button the corresponsding function is executed.
Trying to imitate a Messagebox - in that, a sub will not continue until the user "deals with" the pop up.
For example, in a sub, I want a Form to pop up, and ask a user a question, and give them 3 options. I want to make it so the user must click an option, and then the sub that called it can carry on it's way.
I believe I need a function to make this happen.
Say I've got the following variables:
Public Shared x As String = "100"
Public Shared y As String = "text"
Public Shared z As String = "something"
[Code]....
But this doesn't do what I want, naturally. What I want is that my function giveVar returns the value of the variable that holds giveVar. For example I call giveVar("x") I want my function to return "100".
Of course this can be done by a Select Case but thats not what I like to do. Is it even possible to call a value based on a string?
[edit:]
Namespace i18n
public NotInheritable Class Settings
Public Shared LanguageCode As String
[Code]....
I think this works so far, BUT I get the following error on the CallByName(Me, varName, vbGet) at the Me : "me is only valid within an instance method"
I have an object with a number of properties (let's say object.one, object.two, object.three). There are about 30 of these properties and they all hold a string ("Pass" or "Fail"). Right now the existing code checks whether the property has value "Pass" or "Fail" and then runs some code that prints stuff out. That is, the same snippet of code is duplicated 30 times, one for each of these properties.
The code looks something like this
If (object.one = ... )
...
End if
If (object.two = ... )
...
End if
If (object.three = ... )
...
End if
I want to use a loop to clean this mess up (each block is huge), but am not sure how to do it. I was thinking perhaps there was a way such that I might be able to construct a string like "object.one" and run some function that will tell the compiler that this is actually an object's property? That way I could create an array containing the object's name like my array = {"object.one", "object.two", "object.three"} and then do something like, in pseudocode
For each string in my array
If (some_function(string) = ...)
...
End If
Essentially, it would take those massive blocks of duplicated code and reduce it to just one block. Is there such a some_function that I am looking for? This is in VB.net.
In my .NET porject, I have to run a lot of validation on 4/5 fields. This validation checks if certain fields have errors, for example: the name field is not allowed to have numbers or symbols. If all these checks are passed, I need to execute a SQL query to pull some data out of the database. I could have it with a lot of nested IFs, and run the function at the end once it passes them all, but this will translate into about 12 nested IFs, and it seems a really bulky way to do it. I have also thought about setting a boolean value after every check, and if the value is 1 then don't run the function, else do. But of course this gets overwritten by other checks that pass.
View 2 RepliesThis function doesn't work if I change the input argument 'pdu' from a string to an int.Would someone please help me figure out what to do here so that the checksum does not add the ascii value of the int argument but rather the actual integer value?I took out a few lines of the actual function but it adds the input argument to a packet sent out via TCP protocol.This function shows the integer value just fine in the string that gets encoded as a byte array. the checksum is wrong.!
''Public Function buildpacket(pdu As Integer) is what I want.
Public Function buildpacket(pdu As String)
Dim packet As String
[code]....
I'm wondering whether its possible to have a function's return type and input arguments as a variable.
For example this function:Private Function MyFunction(ByVal argument1 As VariableType) As VariableType
[Code]...
Can I make a certian function that will fade out [make a black screen that fades out for 2 seconds], then come back? Is that possible? ON A FORM.
View 3 RepliesI am trying to create a function to remove dirty words from user input text and want to replace those dirty words with four ****. In my scenario , i have list of dirty words where i would iterate the input user text and want to replace. Say for example.,
Dim InputTxt As String = "hi bush how are you.... $hit and @ss"
Dim OutPut As String = " hi **** how are you... **** and ****";
Problem: It works fine to replace some word like " bush" however fails in the below function doesn't replace "$hit" and "@ss".
Note: I do not want to use string.Replace because it doesn't have word boundary in the sentence..
Public Function pReplaceWords(ByVal dirtyWord As String, ByVal inputText As String, ByVal options As RegexOptions) As String
Try
[Code]....
i want to generate a serial key which depend on system harddisk manufacture id ...
so Is any function which take string of alfanumeric + special char as input and after encrypted return output as unique serial key / product key...
I've got a basic logon form where if you enter the right password/username, it redirects you to the "MainMenu" Form How can I make a function called "checkLogon" that checks the username/password text to a variable in that function?
View 3 RepliesHeres my code
Public Class Encryption
Private _cipherEngine As New Cipher
#Region " PassEncryption "
[code].....
Is there a way to make an input box value required? I have an input box that assigns the value to a label on my form, and I would like to know if you can prevent the user from leaving it blank and instead require a value?
View 7 RepliesI would like to know how to make my l(length) always bigger than w(width).eg: message box "Make Length bigger than width" and the 2 inputs, and 3 outputs = [blank]
Public Class Form1 Dim min, max As Integer Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
[Code]...
I am writing a small program here and this i=code is straight out a book and it doesn't seem to work. Its supposed to ensure that the users input is numeric and not contain letters.
Module Module1
Sub Main()
Dim user_Input As Single
Dim H As Single
Do
Console.Write("Enter you'r Height in Meters: ")
user_Input = Console.ReadLine
Loop Until IsNumeric(user_Input)
H = CSng(user_Input)
Console.WriteLine("You are {0} meters tall", H)
End Sub
End Module
Is there any way to get me a condition like this? If textbox1 (has string or integer inside) then how to make a condition if the textbox has an input in it or none?
View 2 RepliesI'm trying to catch up on my school work and for my evaluation I need to make an application where you input 2 numbers. We will call them x and y.
View 7 RepliesIs it posseble to make a webcam input?I dont have a webcam, but i have some orc and simular programs that requires a webcam (I cant change the programs to take another input)I was thinking on that i maby culd make a "fake" webcam input that was playing a movie file.
View 1 RepliesI used to program in BASIC, and am trying to learn VB now. What I am trying to do at the moment is take a keystroke on the numeric keypad (1-9 only) and pass it into my program to control what happens to a number as follows:[code]I can't seem to find anything in VB that allows simple keyboard entry in this manner.
View 2 RepliesI am new to VB.Net and programming all together. I am trying to make a program that will take 2 numbers input by the user, Add them together and display the sum. Then take the sum and divide it individually by each number to give you what percent of the sum the numbers are. I'm working on making it a program that will calculate the Hardy-Weinberg equilibrium for my Anthro Class. I'm just doing this for practice for my VB.Net Class. But i will move onto that at a later time. I just want to finish this first.
So.. Here is my code so far. It's not complete yet but this is should be enough to make it function.
[Code]...
I've tried to make a program whereby the input affects a variable.
If Label1.Text = "1" Then
store.number1 += 1
End If
[Code]....
I was just wondering if anyone knew of a better way of doing this, as I have to go up to 6 labels, each containing 100 numbers.
my program creates an error code when i enter the worng data but is only does it once, what code do i use to make it stop you until you enter the corrct data
View 4 Repliesi need to take user input and make a very simple bar graph from it in vb.net.
View 3 Replieswondering what i should use to make the 1st letter of the input users name is Capitalised.
so textbox 1 they would enter - josh and when its shown in any labels is shows - Josh
would ucase be used here ? im not sure.
I am trying to make a GUI that can input data into an exe that is already made.
View 1 Replies