Design A Sudoku( 4*4 ) For VB Assignment?
Sep 26, 2011i need to design a sudoku( 4*4 ) for my VB assignment..and i am having problem with generating random numbers for the four text boxes i have used..
View 4 Repliesi need to design a sudoku( 4*4 ) for my VB assignment..and i am having problem with generating random numbers for the four text boxes i have used..
View 4 RepliesI'm a student in a visual basic class and I've been asked to make a Sudoku solving program that writes to a table in access. I need help getting the values from my numeric updown boxes. I keep getting dimensional arrays and conversion errors when I wasn't trying to convert anything. I don't know what to do. I've been researching every night for days now, and I can't find any examples of coding a numeric updown box into an array. I have also thought about writing the numeric updown boxes into a table and then running checks on the rows, columns, and quadrants inside the table. Yet again, I can't seem to find any good examples of this either. I will continue researching and hopefully come up with something other than 64+ if inside if statements. I know in theory I could use arrays to compare the values, but I can't get it to work. I'm not entirely sure how to compare them with the quads either.
[Code]...
I am working on a Sudoku project and am stumped on how to finish my code below so that it will check the rest of the rows in the specified c
Private Function validCol(ByVal col As Integer)
Dim myCol(8) As Integer
Dim valCol As Boolean = False
[code].....
I'm currently trying to program a sudoku solver. I wrote pseudocode to establish what I'd have to do. One of the first things was to make sure each number in each of the 3 x 3 grids aren't equal to any of the others. Here is my attempt. I'm pretty sure I've gone the long way around tackling this but it was the only way I was fairly confident I knew how to do. txt1_2 means that it's the second number in the first 3 x 3 grid (from left to right). At the moment, even if I put in different numbers, it comes up with two of the 'error' message boxes. This code only focuses on the first 3 x 3 grid.
Public Class Form1
Private Sub btnSolve_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSolve.Click
Dim Group1(8) As String
[CODE]...
I have created my webpage in asp.net in 1024*768 resolution, my problem was that when i change my monitor resolution then the controls in my webpage will be displayed in unmanaged manner .
How to arrange items in my webpage which support multiple resolution ...
Whatever the resolution of my monitor the controls in my webpage will display as it is as managed in 1024*768 reolution !
I seem to have reached a limit on the size of the form. I cannot make the form longer and I need to add more fields. Is there a limit on how many fields can be included in a form?
View 1 RepliesI searched codeplex and google. I have found so many such as tustena but unfortunately they are not domain driven based and in these solutions I could not find a good modelling documents or references. i am a newbie in CRM but I am sensetive to design it with solid object-oriented fundamentals. Any reference or open source solution especifically for CRM design and implementaion in .NET? Cheers
View 1 RepliesI have a school assignment and I just started to learn VB. Until now I/ve done pretty good however I encountered a problem which I can't solve in this assignment. So, I would ask if someone could tell me what I'm doing wrong?
This is the assignment:The application calculates the new hourly pay for each of three job codes, given the current hourly pay for each job code and the raise percentage (entered as a decimal number).
a.) before the form appears, use the InputBox function to prompt the personnel clerk to enter the raise percentage. You will use the raise percentage to calculate the new hourly pay for each job code.
[Code]...
Concerning this code... Dim i1 As Integer = Nothing
[Code]...
Is there a way to set a variable in VB.NET in an IF statement. I would like to do the following:
[Code]...
Is there some way I can get the last "ElseIf" to work? I know I can re-write it to get it to work but is there some syntax that will make it work the way it is?
I'm having an odd problem with an ASP.Net page.I'm getting an object not set error message when assigning a string literal to a variable. [code] And here is the code that the error is pointing to. The last line in this fragment is the line 10 the error is complaining about [code] It seems it fails on accessing any reference type, even if it is declared locally in the load function. I originally found the problem when Request. IsSecureConnection was nulling out on me. I eventually discovered I could replace it with the above code and fail in the same way. The problem does not always happen. It seems to be triggered by publishing an update from Visual Studio, or when I head home for the day and the server sits idle all night. One or two app pool recycles seems to clear it up, and the page functions correctly. I've been doing desktop development for a few years, but I'm fairly new to web development.So maybe this is something obvious I've got configured wrong. I'm currently using .Net 4 on IIS 6. That code is in a foreach over an IEnumerable(of XElement). The stack trace still points to the string assignment, but all other stack traces are spot on, so I don't think it's a bad pdb.Also, when the error occurred this time, no amount of recycling the app pool or stopping and starting it would fix the error. I finally got it working again by switching the application to a different app pool.
View 2 RepliesWhy aren't the assignment operators (+=, -=, *=, /=) overloadable in VB.NET?
View 1 RepliesIf I put:
variableName = namecombobox.selectedItem
or
Dim variablename as type = namecombobox.SelectedIndex
Visual studio gives me the error: "Option Strict disallows conversions from object to string.
I can fix this by putting:
variableName = convert.ToString(namecombobox.SelectedItem)
Are all values contained in a combobox automatically treated as a non-string even when they are string values (in this case "Male" & "Female") and what is the correct way of assigning the value selected in a combobox to a variable?
i am making a program on visual basic 2010 and part of my objective is to calculate the tax, i am trying to calculate the TAX so this is part of my code and this is the only part which gives me errors:[code]
1. Constant cannot be target of an assignment
2. value of type 'string' cannot be converted to 'System.windows.forms.Lebel'.
I have an assign ment that says: create an application to let the user enter his or her name (first and last name), then displays the Initial in Upper Case. FOr example: you enter "John Wow", then the Label will display "JW". I know that I'm supposed to use the Substring method. But to use the Substring, I have to have the exact location of the Leter that is going to be displayed in the Label.The problem is: the name that the user enters always vary. So in strnewstring.Substring(... , ...) ---> the number in the parenthesis would vary, too. Thus, I cannot put a number in there.So how can i create a code for this particular assignment.
View 4 RepliesWhat is the difference between this two ways of returning value in a function in VB.NET?
Using Return Statement:
Public Function Foo() As String
Return "Hello World"
End Function
Using Assignment:
Public Function Foo() As String
Foo = "Hello World"
End Function
I'm using the first one then I saw someone using the second. I wonder if there's a benefit I could get using the second.
Maybe this is a n00bish question, but I'm used to c++'s pointers and references and this is confusing me a bit. Let's say I have the following scenario in a VB.net application:
[Code]...
The situation is this: I have a collection of objects, and during execution of the program, any of them can be fetched from the collection to be used/edited by another part of the program. Now obviously if I edit the data inside the object it is allright, but what if I want to replace the object, as I did above at line 5? I would change only the local reference (y) but not the object inside the collection!
Is there a way around this? How can I take with me a "reference to the object's reference", instead of just a reference, so if I reassign it it will also reassign the one in the collection? I hope I'm making myself clear, unfortunately english is not my native language, to be clear: in c++ this would be easy using a pointer to a pointer, or passing a pointer to the object always by reference, so calling new or reassignment on it would change the original pointer itself)
i would like to hijack the assignment operator and do some customization before an instance of my class is assigned.
example:
Dim A as New MyClass
Dim B as MyClass = A
i want custom the behavior of = is that possible?
I have post several parts of my assignment. Can someone advise me on how to do a log on screen. I have a splash which is on a timer, which is supposed to go to a logon screen. I have created the database project in visual studio 2008. Database was created in ms access 2007.
View 2 RepliesI've got one for you. I am working on a program that calculates the cost of a trip given a specific price of a Workshop say "Handling Stress for $595" the length of the workshop say "3 Days" and the city the workshop is in say "Austin for $95/day" now the issue i am having is that for example my NumDays variable (the variable for the number of days of the workshop) is not taking the value. Ive ran a Watch on the variable and it stays at 0. It also displays zero. i have assigned it an integer so it should be working if I assume correctly.
[Code]...
I am fairly new to Visual Basic, but have had extensive experience with TI Basic and am 1 month into a class at my high school in Visual Basic.I recently began a blackjack application that will play as if you had actual randomized cards. I currently have 2 variables per card, one for the value (random integer 2-14), and one for the suit (random integer 1-4). I have pictures of all 52 cards with this numbering system (21.png, 22.png, etc. The compiler understands picturebox statements as
PictureBox1.Image = My.Resources._21 It seems like there would be some way to have a variable assignment, but
PictureBox1.Image = "My.Resources._" & You1Card & You1Suit isn't recognized as it is a string. Is there some way to either randomize the pictures to generate a random picture in My.Resources as opposed to integer representations of cards? Or is there some way to have the PictureBox assignment accept a variable string?
This assignment works for me TryCast(Me.NamingContainer, LDHello).ToggleChartConfigurationSections = AddressOf LD_SayHello whereas Dim objLDHello As LDHello = TryCast(Me.NamingContainer, LDHello) AddHandler objLDHello.LoveAndLoveOnly, AddressOf LDSayHello fails with an error message like LoveAndLoveOnly is not an event of Universal.LDHello. Visual Studio intellisense is able to pickup the event whereas the background vbc and build compiler are failing. When I need to stack multiple subscribers to the event I need to use AddHandler right?
View 6 RepliesI have a custom class that simply contains a public variable X.Let's say I have two instances of the class, A and B.If I execute an assignment operator, such as:A = B then I want A.X equal to the VALUE of B.X.But, I'm pretty sure that this will just assign B to the variable A.Assigning pointers, in C++ lingo.I looked in the VB.NET docs, which state that "The operator can be overloaded only as a relational comparison operator, not as an assignment operator."
View 7 RepliesI have a set of nine double variables declared earlier in a program (i.e., phq91 through phq99) that I have placed within an array. The variables need to hold numeric data that correspond to item responses within combo boxes.
View 6 RepliesI'm completing our assignment we are using vb.net as front end and ms access 2003 as back end but are unable to delete data in the database after clicking on delete button it shows result on front end.code for next does not work give code for next
View 2 RepliesI am having a structure that is actually a simple byte with more functionality.[code]...
If there would be a way to inherit from Structure I would simply inherit from Byte adding my functionality, basically I just need a byte Structure with custom functionality.
My question is also valid when you want to define your new singleton member value-types (like, you want to define a nibble-type for instance etc.) and you want to be able to set it with an assignment to number or other language typed representation.
I'm working on a program for keeping track of class assignments and have most of it worked out, however, my coding skills are rather lacking of knowledge beyond a basic if/then statement.there's a flowlayoutpanel with 40 groupboxes w/ various things in them, including a delete button.so my idea was if someone wanted to delete an assignment, they'd click a 'delete' button inside the groupbox. problem is, if the user had assignments lined up like
groupbox1
groupbox2
groupbox3
groupbox4
and they wanted to delete the assignment inside groupbox2 lets say, it'd need to make everything in groupbox3 and 4 move up...the way i thought to do this was to have the text and properties of the items in groupbox3 = the ones in groupbox2, gb4 = gb3 and gb4 gets a clean slate... so everything just moves up.coding for that was very inefficient as well .so my idea was that the 'deleted' item would instead get 'recycled' (so to speak)like this:
user deleted gb2 of 4
gb2 gets sent to the bottom of the flp and a clean slate (no information in it)
gb3, 4, 5.....so on till 40 automatically move up 1 spot in the flp
I am using VB.Net 2008 Express.I am trying to move a button on a form, the button status is unlocked. The code that I want to use is:
Me.btnEnter.Location.Y = 474
However, I get the error message, "Expression is a value and therefore cannot be the target of an assignment" If I now code as follows, I get the error message, "Property access must assign to the property or use its value"
Me.btnEnter.Location.Y
The errors appear contradictory. Just to check, I wrote the following
X = Me.btnEnter.Location.Y
And when run I received the correct answer of 535.What is happening? What am I missing?
Suppose a teacher has five students who have taken four tests. The teacher uses the following grading scale to assign a letter grade to a student, based on the average of his or her four test scores.
Test Score Letter Grade
90-100 A
80-89 B
[code].....
I have to make a visual basic program for a school assignment. I am an absolute beginner at it though, but am willing to learn.I have to make an income calculator for farmers that make giant turnips.
So basically:
1. If the turnip weighs less than 350kg, the farmer will receive $2 per kilo
2. If the turnip weighs 390 or more, the farmer gets $1.50 per kilo MINUS $180 for a maintenance fee.
3. If the turnip weighs between 350 and 389kg, it has to be sent to a paddock that costs $25 per week for lease. Turnips loose 1% of their mass per week in this paddock. When the turnip gets below 350kg it can be exported. As ships depart weekly, turnips may drop a bit below 350Kg before departure.
Create a profit calculator for the turnip farmer for a list of cattle weights.
Functional Requirements: oEnter the weight of each cow into an array oCalculate the income from each cow and store in another array oAdd up the values in the array and display total income.