.net - Finding A Childs Row And Column In UniformGrid Based On Index In WPF?
Apr 10, 2012
In WPF, I have a Uniform Grid and would like to be able to find the row and column based on the index of a child element.
I know there is a mathematical way of doing this and would rather not use a normal Grid.
If it helps, I can get the total number of rows and columns by using:
Math.Sqrt([*uniformgrid*].Children.Count)
View 1 Replies
ADVERTISEMENT
Apr 23, 2012
i am having trouble putting a value in a textbox. Each time a ticket is sold i put the total price in a textbox, each time a ticket is sold for the same concert it increases by adding its self to the total price. It works at the first sale, but after that it breaks down. here is the code
Private Function DisplayMoneyTaken() As Integer
Dim totalMoney As Integer
'open the database connection
[Code].....
View 1 Replies
May 20, 2009
i need to do a macro. this is what my excel looks like
1 2 3 4
seq1 name name seq2
abcde vv1 abcdddd
abcxy vv2 abcdlmn
[code]....
View 1 Replies
Dec 5, 2010
I am trying to find a record within a nested Dictionary, so that I can add more records to the sub-Dictionary.
The intention is to be a dynamic configuration, where no matter what I pass into it will group into like item categories that have already been added. If there are no like items it will add a new category.
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim xConfig As New Dictionary(Of String, Dictionary(Of Int64, Object))
[Code].....
View 1 Replies
Oct 22, 2010
I have a text file that is automatically generated by an older computer system daily. Unfortunately, the columns in this file are not delimited and they are not exactly fixed width (each day the width of each column could change depending on the amount of chars of the data in each column). The file does have column headings, so I want to find the width of each column using the column headings. Here is an example of the column heading row:
JOB_NO[variable amount of white space chars]FILE_NAME[variable amount of ws chars]PROJECT_CODE[variable amount of ws chars][carriage return]
What I want to do is get the index of of the first char in a column and the index of the last white space of a column (from the column heading). I would want to get the index of the "J" in JOB_NUM and the last white space before the "F" in FILE_NAME for the first column.I guess I should also mention that the columns may not always be in the same order from day to day but they will have the same header names. I know I can use the string.indexOf("JOB_NO") to get the index of the start of the column, but how do I get the index of the last white space in each column? (or last whitespace before the next first non-whitespace that denotes the start of the next column)
View 3 Replies
Apr 6, 2010
How can i get the Column Index and the Row Index when I click on the ListView?The ListView1.FocusedItem.GetSubItemAt(e.X, e.Y).Text function only gets the text of the first column, I can't find the option of getting the Index of the Column and Row upon clicking.
View 9 Replies
May 19, 2009
i'm having a little trouble with a listbox. [Code]. i want the button command to run through the listbox items and proceed with given command. it's not listbox1.items.indexof(#), it's something else i'm missing.
View 2 Replies
Nov 19, 2010
I have a checkedlistbox to which a dataview is set as its datasourceI also have a string array that contains valuemembers which need to be matched to the items in the checkedlistbox, of which if complying the checked state needs to be se
View 3 Replies
Jan 18, 2012
Is there a way to find the column index of a datagridview column using the columns DataPropertyName?I currently use a loop (shown below in the class) which is kind of ugly, but it works. I'd like to do something like this, which seems more elegant.My goal is this, I store the users DataGridView column settings (i.e. DisplayIndex, Visible, & Width).When the user opens the form that contains the datagridview I want to get those settings from the database and apply the settings to the datagridview.[code]
View 5 Replies
Jul 16, 2010
What will be the steps for finding the DFD of A Project based on Banquet Hall?The project if of basic level.
View 2 Replies
Apr 18, 2010
I'm an intermediate student taking on a monopoly game for a summative project. I decided to simulate the game monopoly. The rules are the same as the board game, so the idea is that each "property" or board piece is a button. I will have variables for the players position and player totals. To indicate an owned property, I'll change the buttons to flatstyle and use the bordercolor property.
To indicate the player position, I change the text on the button to include "Player: " etc. The trouble I'm having is that each button is named based on position, followed by the name. ie: "btn1Start", "btn2BalticAvenue", so on and so forth. Now, once I roll the two die and gather random integers, I add the total to the player position. Now what I want to do is find the button that the position corresponds to.
Private Sub turn(ByRef playerPosition As Integer)
Dim die1 As Integer = Int(6 * Rnd() + 1)
Dim die2 As Integer = Int(6 * Rnd() + 1)
playerPosition += die1 + die2
Dim button1 As Button = ?
I've tried various methods. Me.Controls.Contains("btn" & Position) is a boolean, so I can't make an object control class equal to that. Me.Controls.Find requires an exact name, so I can't do Me.Controls.Find("btn" & Position) because it needs the full name - each property has something else added on to the name (eg "BalticAvenue"). I want to set the button equal to the specific button based on the turn position, so I can update the text to include the player and allow him/her to initiate the property's effect (buy/pay rent/or chance cards).
View 29 Replies
Mar 13, 2009
table named mytablei have columns like this
[Code]...
i would like is to include amount1 and amount 2 values into sum only if amount1paidstatus="yes" for amount1 and amount2paidstatus="yes" for amount2, something like for selected day and selected customer.query "should" look something like this:select amount1(if amount1paidstatus=1)+amount2(if amount2paidstatus="yes")from my tablewhere (day=1) and (customer=1)
View 2 Replies
Nov 15, 2010
I'm writing a help application for the Customer support team at my company to help agents ask better questions when customers report problems. In it, I've got a SQL database that contains all the products, topics, and questions. The layout is similar to the following:
Products Table:
Product_ID Product Name:
Topics Table:
Topic_ID Product_ID Topic
[code]....
I don't know if I'm making myself clear, but I basically need to do the equivalent to the following SQL statement: "SELECT PRODUCT_ID FROM Products WHERE PRODUCT_Name = LstProducts.SelectedValue"
View 2 Replies
Apr 15, 2012
What will be the steps for finding the DFD of A Project based on Banquet Hall?
View 1 Replies
Dec 13, 2010
I have a data gridview on my windows form with 4 columns. Now I identify a column as followed:
Dim item1 as String = DataGridView1.Item(1, index).Value
So now I use a number ( In this case: 1 ) for the column index, but I want to make it a bit more readable so now I want to obtain the column index based on the datagridview column name.[code]...
View 6 Replies
Sep 5, 2011
Does any on know how to find the index of a row in a data grid based on Checkbox = true. ?I may have several check rows and need the index to update an insert query that updates anther table.
View 5 Replies
Aug 15, 2010
How should i set the combobox selected index based on the "value". The following is the sample code. I am getting an error on the button click event.
[Code]...
View 9 Replies
Nov 1, 2011
I get this error when clicking on any of the letter buttons in my repeater. The sql statement I have works in sql server, but on my page it just errors out. The only thing that is different is that in sql server I change '@CompanyID' to an actual ID and '{0}' to 'a' so the query will run. All the posts I have found online with this problem say something about this-->{0}, but I don't see anywhere that I might be trying to pass more than one argument or have this wrong.[code]
View 1 Replies
May 25, 2011
Is it possible to select a value of a drop down by its dynamic index that is returning from another function whereas selectindex = 2 (generated dynamically)
selenium.Select(Id, "index = SelectIndex")
View 1 Replies
Sep 7, 2010
is there a way to retrieve text value from a listbox based on index ?like if i enter index 0 and want to retrieve it's text value from the listbox
View 5 Replies
Feb 2, 2012
I created a .NET application that reports to a log file the contents of a registry key. My code works perfectly but it is choking on one of the string values found in the registry. The code that works normally is below.
[Code]...
View 8 Replies
Apr 18, 2009
Sub Users_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Users.Click
Dim fmtstr As String = "{0,-15} {1} {3}"
[code]....
View 3 Replies
Jun 7, 2012
First of all, I'm a somewhat-experienced VB3 Developer, and I'm trying to convert a VB3 app to VB.NET.I got the programming guide (http:url....) by searching the web.The problem I'm having is the syntax for .NET is way different than VB3, and that's OK, but finding the correct syntax is very difficult.I'm trying to eliminate duplicates in a ListBox:
When I access the Programing guide, I see that:
ListBox.SelectedIndex Property
Gets or sets the zero-based index of the currently selected item in a ListBox.I also have Murach's and Stephen's manuals, and they say the same thing.Visual Studio converted The old .ListIndex to a VB6 Function:
If VB6.GetItemString(PlayList_ListBox, I) = VB6.GetItemString(PlayList_ListBox, I + 1) Then
This is Try #1. It generates: VB6 is not declared. It may be inaccessible due to its protection level.Then I read that VB6 is only for converting old code.So then I tried SelectedIndex:
Dim I As Short [code]..........
View 9 Replies
Nov 9, 2010
I've tried to use the DMAX Function in my VB windows application to find the highest value in a column in one of my tables, however it doesn't seem to work. After doing some research, I think that the function is only relevant to VBA, although I could be wrong.
'show me the maximum HCCID - DMAX
'Dim HCCNUM As Int32
'HCCNUM = DMAX("[HCCID]", "tblHCC")
How to find the maximum value in a column in one of the tables in my database?
View 12 Replies
May 17, 2012
We have a DataGridView with 3 columns: InvoicedOn, PaidOn and Amount
On the MouseDown event is this line of code which needs to be fixed:
MsgBox(DataGridViewPayments.Item("Amount", DataGridViewPayments.CurrentRow.Index), "")
We are trying to find out what the value in the Amount column of the curent row.
We also get this error message:
Conversion from string "" to type 'Integer' is not valid.
how to fix the MsgBox so it will show the value?
View 2 Replies
Oct 15, 2009
I'm connected to an access database using VB 2008.. there is information already located in the tables. But what I am looking to do, is find the "SUM" of all the data in a certain column.
View 35 Replies
Feb 1, 2011
i am getting a syntax error at drr(5) which 5 is the column i want to base the color change on. this method works when i am using a dataset
Dim Land As String = "Land"
Dim Air As String = "Air"
Dim Cruise As String = "Cruise"
[Code].....
View 3 Replies
Oct 24, 2011
Using VB.NET i want find a specific string that occurs in column B of an Excelsheet and copy that entire row and paste it in a new worksheet. This string occurs a couple of times in this B column.I know how to open up an excel sheet in VB but I'm having difficulties searching for the string and then copying that entire row and do it multiple times (loop until the end of the column)
View 4 Replies
May 4, 2009
I would like to format output to a property of a custom control I have made.For instance I have a literal control in my control and when populated I want to check if it is longer than 30 characters long, if so, then go to the next space (as to not cut the word off) after the 30th character and place a <br /> tag in to place the next 30 characters on the next line.So if there were 100 characters in a string, there would be 3 line breaks in the label.I have the looping worked out to get the label populated but cannot get how to dymaically create the array based on the string lenth property and index of method.
View 7 Replies
Mar 4, 2010
I need to refer to some strings using an "indirect string" in the registry. It should be in this form:
@filename,resource
MSDN: "If the resource value is zero or greater, the number becomes the index of the string in the binary file. If the number is negative, it becomes a resource ID."How can I find out either of these numbers for my resources that only have names in VB? I also need the ID/index for the exe's icon.
View 2 Replies