Turning A Boolean FALSE If The Right KeyData Isn't Pressed?
Aug 2, 2010
A week or so ago, you folks really taught me how to use the KeyData event. I adopted some of the coding to make my new code so much better. A few days ago, I thought I figured out how to run my little game. You see, you have two buttons. Comment and Uncomment. You Press Control + K and then after that, you press Control + (C or U) to activate the buttons. And I thought it worked! But my buddy figured out how to break it! The thing is, I need to figure out a way to make IsCtrlK (Look below) False if any key that isn't Control + C or U is pressed right after it. What would you suggest I look into using?
[Code]...
View 4 Replies
ADVERTISEMENT
Jan 18, 2010
I'm pretty new to Vb so I'm not sure of all the correct terminology etc.
Private Sub Add_mousedown(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Add.MouseDown
Dim Addition As Boolean
[code].....
View 2 Replies
Jan 26, 2011
coming from this question i was wondering why:
[Code]....
'this throws an "Object reference not set to an instance of an object"-Exception'
[Code]....
A CType(obj, Boolean) would evaluate to False(just as CBool(obj)), i think because the compiler uses a helper function, but that is not my theme. Why does casting Nothing to Boolean evaluates to False, whereas casting an object that is Nothing to Boolean throws an Nullreference-Exception? Does that make sense?
View 4 Replies
Jan 17, 2011
This is probably a really basic (no pun intended) question, but I can't seem to find an answer anywhere.Why does the result of func1 return False and func2 returns True? On every other test I have done, integer 1 is converted to boolean true and 0 to false. Works ok if I just set rtnValue to 1 or 0.
View 3 Replies
Jul 28, 2011
I have a math program that I am working on. One of the exercises has a random word and 6 radiobuttons. The user has to select the radiobutton that displays the exact number of letters in the random word. What I am having trouble with is creating a Public Function to check if the answer selected is the correct one. The radio buttons are within a groupbox. The Public Function returns a boolean True or False.
View 4 Replies
Sep 21, 2011
I have a HTTP class that gets content from URL's, POST's content to URL's etc and then returns the raw HTML content.In the function inside of the class it detects if there is a HTTP error and if so I would like to return false but will this work if I have declared the function to return a String?
Code Sample of what I am trying to do (Note the Return Content & Return False if a HTTP error code is detected)Public Function Get_URL(ByVal URL As String) As String
[Code]...
View 1 Replies
Jan 1, 2010
what is a difference between keycode, keycharacter, keydata, keyvalue and in what perspective they are used.
View 2 Replies
Nov 15, 2011
Is there an easy way to get the corresponding keydata (keycode combination) for some value in that enum? I cannot find one, and creating a switch statement for all those is a bit overkill...The integer values of the enum elements are not keycodes, but some 'unknown' big numbers, so simply casting to int won't work.
View 1 Replies
Nov 17, 2009
From what I read it is a good convention to name a method that returns a boolean value with the prefix of "is" or "has". So in keeping with this convention I am trying to name a method in my program with this prefix but I am running Specifically I have a class called Day. It is a simple class with a few data members and one method that returns a boolean value of true or false. The name of the boolean variable is isSpecialDay. This class has a method called isSpecialDay which takes the date of the day, applies some criteria to the date and then sets the variable isSpecialDay to true or false. My problem is that the boolean variable is named isSpecialDay and so it the method. What should I do?
Public Class Day
Private TheDate as String
Private DayName as String
[code].....
View 8 Replies
Aug 14, 2008
How can I set a button, so that when it is pressed, it stays in the pressed down graphic state. Then when pressed again it returns to the normal not-pressed visual.Make a button stay like this until pressed again: url....
View 3 Replies
Oct 17, 2011
I have a TextBox and set the MiltiLine property to true and AcceptsTab property to false.When the TextBox has focus and i press Tab it works fine and the next control get the focus, but when i press Ctrl+Tab it works as if AcceptsTab property is set to true and makes a tab character into the TextBox.The reason i press Ctrl+Tab.. when switching between forms in my MDI application.Now how to make a Ctrl+Tab when pressed works like Tab when pressed in a MultiLine TextBox?
View 1 Replies
Oct 27, 2011
After Filling a DataTable in GridView's DataSource . A column with check box Type appears but it created as read only column and I can't enable it or make it editable... even i tried .readonly = false and still can't be edited
View 1 Replies
Mar 5, 2010
I ran some code through an automatic translator for C# to VB, and it translated some code like this:Public Property Title As [String]How is this different to Public Property Title As String
View 3 Replies
May 21, 2010
Some of you might remember that my application got data from a PLC which is a Short. That is converted into his base 2 equivelant and turned into a boolean array.Problem is, this 16 bit word i'm getting is little endian (right to left) and I want to turn it into a big endian (left to right).
View 3 Replies
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
Nov 10, 2010
I'm trying to use System.Diagnostics to do some very basic logging. I figure I'd use what's in the box rather than taking on an extra dependency like Log4Net or EntLib.
I'm all set up, tracing is working wonderfully. Code snippet:
Trace.TraceInformation("Hello World")
App.config:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
[Code].....
That doesn't make sense to me: I just have to declare an instance of the BooleanSwicth to be able to manage (disable) tracing via the .config file? Should I like ... use ... the object somewhere?
View 4 Replies
Aug 24, 2010
This shows a form, header and footer are to be kept fixed. In the middle there is a Group Box that hold a question with different option. When user clicks Next button at the bottom, Group Box loads next question. I want
View 4 Replies
May 16, 2011
I'm trying to turn a string array that contains string , numeric and date values some of the string values are in hebrew when turning them to a single string (using join or through a loop) the order of the values comes out wrong
[Code]...
View 1 Replies
Oct 7, 2011
Basically, my program is supposed to display the list of students that have been entered. (Into a listbox.) Here's the AddStudent code (which works as far as I know)
Public Sub AddStudent(ByVal FullName As String, ByVal Gpa As Integer, ByVal Major As String, ByVal SocialSecurityNumber As String)
_FullName(ENROLLMENT) = FullName
_Gpa(ENROLLMENT) = Gpa[code]......
Here's where the problem comes in...I need to return a value from "GetAllStudents" that can be used with the lisbox. Here's the code for that:
Public Function GetAllStudents() As String
Dim i As Integer = 0
Dim aryStudents(50) As String[code]....
This obviously doesn't work. It gives an error that I can't convert a 1dimensional string to an array.
View 6 Replies
Feb 1, 2009
i have a simple list Format
[Code]...
Its extracted from a text document and put in a multi line textbox in the same format. What I want to do is read each line and put it in an array, however i couldn't find code to read line by line, so I have a series of questions
1. What code do I need to put in an If statement so if it is a return (i.e. the next line) Then it runs
2. Is there a simple way to read line by line in multi textboxs so I don't need to do question 1
View 4 Replies
May 3, 2010
I want to turn a string into an array like so...
dim str1
str1 = "hello world"
arr1(0) = "h"
arr1(1) = "e"
[Code]....
just assume i declared all those vars. it doesnt seem to like my i variable in the Mid function
View 4 Replies
Sep 5, 2011
How do turn text from a textbox say w into a key to be sent?
View 1 Replies
Nov 6, 2011
My coworker's installation of visual studio 2008 breaks every time there's an exception, mine doesn't.
We've been looking for how to stop his from doing this but haven't had any luck. The only difference is that mine was initialized for C# while his was initialized for VB.
Other than reinstalling and choosing the option that says "Optimise for C#" when VS2008 sets up the environment for the first time
View 1 Replies
Jun 10, 2011
I am supposed to be writing a program for my instructor using VB 2008. It is sort of like a quiz program. You build the "light bulb" program but instead of names and colors, it consists of two forms. Question 1 with a "next" button and the second form for Question 2 with a "previous" button. I have no idea how to link the two so that when you click "next" it goes to the second page and vice versa.
View 2 Replies
Nov 29, 2011
When I run the apps, one radiobutton is checked though the checked properties is set to false. No code setting it to true either I tried deleting and creating a new one but it is still setting checked to true at
View 18 Replies
Jan 17, 2010
Notice that some files use vbnewline, some use unicode encoding, and so on and so on.
View 1 Replies
Dec 13, 2009
I need a way to turn a whole folder full of .JPG Files each named 0 - Infinity(each numbered) into a video of some type. I really don't care what type of video at this point as long as its a video.
View 2 Replies
Mar 11, 2009
Is there a way to turn option strict off for just a single line of code?
I'm doing some maintenance work and I need to "cheat" in just one place and I don't want to lower the standard for the entire file.
View 3 Replies
Apr 12, 2011
I have a table of chars. What is the most acceptable method of turning this array into a string.
Ex:
Array: ['a']['b']['c']
-> abc
View 3 Replies
May 2, 2012
I am creating pivot tables in VB.NET and have run into a problem I did not think would be as difficult as it is turning out. When I create a pivot table it adds in subtotals for each row and I do not want that. In excel you just drag down the subtotals option and tell it to not display subtotals. I looked into the VBA for it and it is several lines long of this format:
ActiveSheet.PivotTables("Main Highway Pivot").PivotFields("Division"). _
Subtotals = Array(False, False, False, False, False, False, False, False, False, False, _
[Code].....
View 1 Replies