C# - Whats The Point Of Tuple (Of T)
Sep 30, 2011
Possible Duplicate: What's the purpose of the Tuple(T1)/Singleton in .net?
Trying to mimic a Tuple as implemented in .Net 4 (For .Net 3) I just realized there is a Tuple(Of T)? This was quite a surprize!
Tuple<string> result = new Tuple<string>("Data");
Instead of this
return "Data";
Isn't the whole point of a tuple that its a container for "loosely related data that isnt cohesive enough to make another class"?
View 2 Replies
ADVERTISEMENT
Dec 1, 2011
I just converted a project of mine from VB2008 to VB2010 All I did was open the solution file with VB2010, at which point it prompted and guided me through a one-time conversion process (no errors)
View 2 Replies
Nov 20, 2011
Retrieving items from a Tuple is done by accessing the ItemX property. Is there a way of naming each item so that using the Tuple will be more readable?
Code:
Looking for something like this:
Dim l As New Tuple(Of String, Integer)
l.Name
l.ID
Instead of:
Dim l As New Tuple(Of String, Integer)
l.Item1
l.Item2
View 2 Replies
Jun 4, 2009
I hve been working with points a lot recently, and I have been wondering if there is a way to set a point without setting point.x and point.y separately. For example for (3, 5): Point1 = (3, 5) But that isn't right
View 4 Replies
Feb 14, 2011
I have a Diagonal line drawn on a picture box on my forum and i need to know if the user has clicked the line I have the Start point and End Point of the Line and the mouse x,y location So i basically need to find out if the x,y of the mouse is on the line.
View 2 Replies
Dec 31, 2010
I'm trying to extract a piece of text from within the string, defining both a starting point and an ending point. For instance, say I want to search for the text found between "That is a " and " car" in the string "That is a red car", so it would return "red".I know you can use .SelectionStart and SelectionLength, but the length of the word can change, so the selection length can vary. What I want is to establish a specific starting point and a specific ending point from which to extract the text from the string.
View 5 Replies
May 24, 2010
I want to know if its possible to loop in a variable and grab info from point a to point b
This is what I have stored in my Variable
PHP
</div> <!-- div reviews end white-space:nowrap; margin-bottom:5px; class="reviews" -->
<div class="list_address">
[Code].....
View 11 Replies
Jul 29, 2009
i have a picturebox which displays a map i have 2 modes add point and delete point when the user clicks the picture it creates a point on the picture where the user has clicked that works perfectly its when i try and delete the point when it doesent work :/ i have all the points loading from an xml file this is the code i have:
[Code]...
basicly i want it to when the user clicks the point it fines the x any y in the xml delete the node then delete all the points on the map then reload them all according to the xml
View 9 Replies
Mar 11, 2012
I'm trying to calculate the direction between two points on a two-dimensional grid. Actually I want to determine if that vector is within a range of two values. Suppose the grid's origin is 0,0 at the upper left corner, and 0 degrees represents north. I have a point A on that grid. I want to know if a line from point A to point B on the grid is within a range of directions between 111.8 degrees (a little south of east) and 158.2 (a little east of south). Those are approximations; the 111.8 is 90 degrees plus the arctangent of 2/5, and 158.2 is 180 minus that value. I worked out a series of calculations worthy of a medieval astronomer, but I suspect there is a simpler way. I'm going to have to do this for a variety of other vectors, and I'd like to generalize
View 4 Replies
Feb 20, 2010
I know how I can construct an icon setting point by point, but that isn't what I want. I want to use a bitmap file or a jpeg -is easy to convert an jpeg to an bitmap- and built an icon that looks like this picture.
View 2 Replies
Jan 17, 2009
I want to make a drawing application which needs a few drawing functions I cant handle myself as im not very mathematicly inclined The first on the list of functions is to create an arc from a start point, end point and radius. The method signature is as followes.
Function CreateArc(byval StartPoint as PointF, EndPoint as PointF, Raduis as single) As PointF()
'Code to create an array of points...
[Code]....
View 1 Replies
Mar 25, 2010
I have a question, i have worked in several languages in my life (including several versions of basic) but i wonder whether in .NET using a variable or equation in a loop is a lot slower than not using one? Take the following identical loops
Dim test(999) As Integer
For count As Integer = 0 to 999
test(count) = count
Next
[Code]...
Now the 2nd case is good because it is easier to adjust the code should the array size need to change yet my background tells me the 1st case is the one in terms of performance, test.Length - 1 is calculated each time the loop runs. a loop of the 2nd kind for example has a massive effect on java as well as VBscript or javascript.So heres the question, would test.Length - 1 be calculated each time the loop ran, or just the first time?
View 14 Replies
Dec 28, 2010
Private Sub Recipient_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles Recipient.KeyPress
If Char.IsLetter(e.KeyChar) Then[code].....
View 6 Replies
Jun 13, 2011
whats the requirement of hardware for sql server
View 1 Replies
Jun 2, 2011
if I created a new object like this Dim sqlconn As New SqlClient.SqlConnection(cs)
and Dim sqlconn = New SqlClient.SqlConnection(cs) Whats the difference?
View 1 Replies
Oct 12, 2010
No errors are given in either first or second code besides theinputbox whats wrong here ?
1:)
Dim readings(-1) As integer
2:)
[code].....
View 2 Replies
Jun 9, 2011
I'm doing a project involving VB.Net 2008 and SQL.
I'm trying to make a combobox display whats in the sql database that is connected on the left hand side.
View 5 Replies
Apr 20, 2009
Im trying finish my Chat room and I just need to know how to make it send when they push enter so they dont have to click the button.How would I make it send Whats in textbox1 when they push enter?
View 6 Replies
Sep 30, 2010
I have a RichText area, and wanted to create a button, that will take whats in the RichText area, and come up with the prompt for the user to save somewhere on the machine..
View 1 Replies
Apr 10, 2012
I have a DataGridView that will occasionally have a RowError icon displayed in the RowHeader (shown below)I have code that displays a small form when the users mouse moves over the row header or clicks the row header.I would like to draw aline from the top-left of the form to the middle-right of the row header.I basically want to point from the form to the error icon.
View 1 Replies
Mar 14, 2009
I need to move an ellipse from a known point on the screen to another known point on the screen.
I've tried using For.....Loops with less than desired results.
I can't remember everything I've tried, a lot of trial and error has been layed to waste. Lol
I've ended up with this code after putting together what I've tried, what I've learned elsewhere, and a couple of posts I've read on here.
All I want to do is move the ellipse from one point to the other along a straight line that forms the angle between the two points (X1,Y1) and (X2,Y2), make it grow from 2 pixels at it's start, to about 80 pixels by the time it reaches half way, then shrink from 80 pixels back down to 2 pixels by the time it reaches the point (X2,Y2).
Easier said than done.
Here's what I have at the present.....
Dim W As Integer
Dim H As Integer
Dim Num As Integer
[Code].....
....This seems like such a simple task, yet it's been a week since I came up with the idea, and I've had little success.
View 6 Replies
May 9, 2010
come out with the codes for moving the mouse pointer from point (200, 100) to point (300, 400), repeatedly. Using VB 2008.
View 8 Replies
Jul 28, 2010
I looked around the forum can't find something really simple.I want to scrape everything between the
<!-- google_ad_section_start -->
to
<div class="ad_editorial-sponsorship"></div>
copy it and use it right after it's website and I navigate using webbrowser1.
View 12 Replies
Jun 21, 2010
i want to work on a shooting game,and i already have a code for the rotation of the image but i have a few problemFirst problem(for the tank /ship): i want the image to AUTOMATICALLY rotate facing the mouse cursor,i know how to rotate but but i dont know how to convert the location of the mouse to an angle that the image will face,,
View 1 Replies
Mar 28, 2010
whats the page life cycle in Ajax call in Asp.net?
View 2 Replies
Dec 8, 2010
I was looking on the interweb to see if there were any good examples on how to initialize shared members within a class while still initializing instance variables. I did find an expression that might fit to the answer:
[code]...
How do I initialize both instance and shared members without re-initializing the shared members every time an object is created from a class? Thanks!
View 2 Replies
Dec 3, 2009
i'm trying to check whats the highest rev number in a folder (file names are 123456_rev01.*, 123456_rev02.*).
here is my code
For j = 1 To File.Exists("c: est123456" & "*" & j & ".*") = False
MsgBox("looking at rev" & j)
j = j + 1
[Code].....
View 4 Replies
Jan 3, 2006
I have found lots of posts on the web citing this problem but none of them have solutions, please could someone shed some light on this and help me find a solution otherwise my applicvation will lose a lot of the functionality I have planned?
I have produced a program in VB5 and I have designed a report in crystalreports (4.6). I want to click a button on a form in the program and viewthe report in a view window not in the CR4.6 editor.
I am using the following code to try to call the report however when ittries to start I get a 20536 - Incorrect log on procedures.Additional information:I'm running Win XPI have crystal report control 4.6 selected in the project components menuI have put a CR control on the formI have crystal report control 4.6 selected in the references menu If fixed will this open the report in the viewer window rather than the fullCR editor? (that's what I want)
[Code]...
View 2 Replies
Dec 16, 2009
whats the event handler name for holding click a button.
View 6 Replies
Oct 13, 2008
Is there any way to have 2d graphics that gets made by user through manual dimensions input be bound to a text box?
Is there any way to take position 1000,600 and make that zero? Can we make graphics by inputting only the next co-ordinate and have the pc automatically draw a line from last point?
Also, whats the difference between drawline and draw path? How can I get the shape to remain on screen when I toggle between pages?
View 9 Replies