Forms :: Get The Red Color If The Calculated?
May 15, 2010i have a problem with my program i want to work with 2 color's red and green i want get the red color if the calculated - and green if it is +
[Code]...
i have a problem with my program i want to work with 2 color's red and green i want get the red color if the calculated - and green if it is +
[Code]...
I am attempting to develop a Gradebook that one can use to modify grades and have an average calculated at the end.When you first open the form, you see the database fields in the DataGrid (socSecNumber, firstExam, secondExam, finalExam)I have a button to save the changes made here. The exam grades are null in the database.This seems to work fine, however I have a problem with the calculated column I want to add. I want it to display the socSecNumber and the average for that student. Instead, I get all four fields in addition to the semAverage field. Also, all the grades come up 250 if I fill all the fields in with 100.[code]
View 2 RepliesHow to change a forms background system color schemes to windows default color schemes in vb.net?
View 2 RepliesI need to create a simple label and when the user clicks the label, the label changes color...sounds easy BUT...if the user moves the mouse cursor away from the label and then clicks the label a second time, then label returns to its original color. I am trying to create a loop to loop through two array indices, but it just doesn't seem to work.
View 2 RepliesI didn't like to make another thread so i decided to ask here, maybe somebody knows how to change calendar day color?
View 3 RepliesI am new to VS 2008.. It is possible to change the progress bar loading color (green) to other color? How to change it?
View 3 RepliesIs there a way to customize a forms boarder so that it has a different color, or shape?
View 10 RepliesI'm trying to figure out how to change the background color of a combo box for every item in the selection.[code]This method seems to set the whole combo box back color to whatever the last color was.The color does not change per item.
View 2 Repliesim making a currently making a program called BATCH Studio.Theres just one particular part im stuck with which is changing is changing conditions and loop words to another color. Just like how vb changes the IF and FOR to blue and String. Iv managed to come up with this but doesent really work.[code]
View 5 RepliesI am building a data entry form. I have code that runs when the 'submit' button is clicked to check that all required fields are populated; if not, the missing fields are hilighted in red:
Sub validatefields()
saveOK = True
If Trim(Me.cmbBillCat.Text) = "" Then
saveOK = False
Me.cmbBillCat.Appearance.BackColor = Color.Tomato
End If
My problem arises when I want to reset the color back to normal. In my form when you click Cancel or move to a new record, all fields are disabled (set to read only) until the 'Edit' button is clicked. Visually this is represented by the field backgrounds being gray. VB.Net automatically changes the text box/combo boxes backcolor to gray when I disable them. However, once I have explicitly changed a control's backcolor, thereafter disabling it does not change its color to gray.
[Code]...
I have tried changing the backcolor to System.Drawing.SystemColors.Window, but the problem is the same. The control whose color has been changed is disabled (won't accept entry) but the backcolor remains white, no matter how many times DisableFields() is issued.
i have data coming from sql server with two columns like total items, total packed items. Now in datagridview i want to show another column to calculate %age.Total Packed Items / Total Items Is it possible to add calculated column in datagridview?
View 4 RepliesThis comparison shows the different values of the known good checksum calculation (c#) as used by my client and what I 'hoped' was the vb.net equivalent. How can I get 405 rather than 513 as I currently do?
For i = 0 To length - 2 Step 1
cksum += sendFrameData(i + 5)
Next i
[Code]....
i have three cells in a datagridview third cell gives the result of multiplying first and second cell.When i reload or populate this data from datatable into that datagridview value comes like 40.00. with two decimals. For example
58.00 -------->i need only 58
58.78--------->i need exact 58.78
The only problem is to remove the decimals if they are 0.
I have a DataGridView that call a stored procedure. One of the fields is a calculated field, ie Quantity * Price.When I run the stored proc on the server, the calculated field returns a result that shows 2 decimal places to the right of the decimal point. When I run the stored proc in the VB application to fill the DGV, the result in the calculated field shows up to 8 places to the right of the decimal place. Is there a way that it will show only 2 places in the application?
View 3 RepliesHow are coordinates calculated on a form?
Consider the following code:
[Code].....
Below is some code I use to loop through rows in a datagridview and set the row colour subject to a "STATUS" field and also changing font colour and boldness dependant on whether a flag has been set to true.
Is this code optimal / can it be cleaned up somewhat?
Public Sub ColourMyGrid()
Dim varStatus, varBagTemp As Integer
Dim myFont As New Font(grdResults.Font, FontStyle.Bold)
For Each row As DataGridViewRow In Me.grdResults.Rows
varStatus = row.Cells.Item("Status").Value
[Code].....
I'm just curious that how a month is calculated in the rest of the world because Differences in Months between two dates are calculated differently. In our Insurance Company, we calculate a month as below:
[Code]...
I have a DataGrid as a child of a Customer Form based on a Query like this
[code]...
how to change this Linq to Entities (VB.Net) query to Group by L2_ID column and aggregate the calculated column diff as Sum for the group.
[Code]...
I have a gridview that displays a calculated field, based on a db source field it populates with.
can i sort by it? i can't seem to figure out how to do it?
example:
my templatefield looks like this:
<asp:TemplateField HeaderText="Category" SortExpression="category" >
<ItemTemplate>
<asp:Label runat="server" Text='<%# BuildCategory(DataBinder.Eval(Container, "DataItem.category")) %>'
ID="lblPrice"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
where category is party of the datasource, but what gets displayed is a calculated value - which is different from the category.what can i put in the "SOrtExpression" to make it sort by the new value - taht gets displayed?
I am attempting to teach myself visual basic and I cannot figure out how to send a calculated value (on a button click) into a one-dimension array and then recall the last five values in a message box when the user exits.
Here's what I have:
Public Class frmInvoiceTotal
Dim totals(4) As Decimal
Private Sub btnCalculate_Click(ByVal sender As System.Object,
[Code]....
My program is databound to an access 2007 database. I have a datagridview showing rows as part of my screen and the other part of my screen is texboxes bound to a different table.What I currently have:
1. Date in textbox from one table
2. Age in Datagridview column from another table
I need help with having a calculated date column in the datagridview that will be the textbox date + age (in days) in the datagrid column. I would also need this column to store in my database like any other field also. So if I typed in 2/17/11 into the textbox, and I typed in 2 in the age field, the calculated field would display and store 2/19/2011 in my datagrid and database. My dataset designer won't let me add a date to a string so I'm completely lost. A query calculates it easy in access but when I load the access query in my dataset it doesn't calculate anymore.
I wanted to have multiple color for text in single label controller
e.g.
label1.Text = " $ 480.00 "
What I want is character $ in Red color and other digits or character after $ in color blue. $ 480.00 I cannot use separate labels for digits and $ due to limitation
i'm using VB 2010 and i'm trying to make a transparent images but without success .i draw 2 GIF pictures in Photoshop and save it as transparent.i put that GIF's in 2 pictureboxes on the form and the background of the pictures is really transparent, but when i try to put one picture in the top of the other one, the first picture cover the second one with the background color (and becuase it's transparent it's like the form color)
View 2 RepliesI have invoice form bound to a bindingsource and bindingnavigator. In the form I have unit price, quantity and total textboxes. The total textbox text property is set to total.text = quantity.text * unitprice.text in the textChanged event of both quantity and unitprice text boxes. The result is displayed in the total textbox. But when i hit save button on the bindingnavigator it is set to null and not saved to database. [code]When I used msgbox to see the value of total textbox before bindingsource.endEdit() it is the correct value. but after the code bindingsource.endEdit() it is null. I checked the databinding property and it is correct. What is the problem.
View 1 RepliesI am working with a future value application and I am trying to display the calculated future values in a listbox. For instance, I input the monthly investment, the yearly interest rate and the number of years into textboxes and I want the application to list out the future value for each year until the number of years in which I entered is reached. I cannot figure out how to get the code to display the value after each year. I am trying to use the "mod" operator to display the value each time the 12th month comes around.[code]...
View 7 RepliesI have a RDLC report with a list that contains a table. I require a calculated column whose value depends on values from previous rows. Outside of a report I accomplish the same thing using code in a DataGridView's DataBindingComplete method.
From within a report how do I refer to specific cell values from previous rows? embedded code, but I have not had luck (#Error).
ive been struggling on this portion of my code for almost 3 days with no luck. i have a database containing a list of transactions (in this case, the product name, quantity and date of sale). I want to plot a graph for each product showing the amount sold each month for the past 12 months. The functions to calculate these values are working fine. but my problem is this:
each tab page is named after the product name:
TabControl_SaleOfProducts.TabPages.Add(
"TabPage_"
& ProductName, Item)
and then to this tab page i want to add the graph. but i cannot reference the newly created tab page?
in my tableadapter query i have a count function "COUNT(PRIMVENDOR)" to give me the number of rows in each group by:
SELECT VENALPHA, PRIMVENDOR, [GROUP], COUNT(PRIMVENDOR) AS GrpCount
FROM ViewCurrentMasterFile
WHERE (PRIMVENDOR = @VenNum)
[Code].....
DataGridView1 is bound to a sql table. Cells(0) and (1) come from that table. Cells(2) and (3) are calculated. While debugging the code, the calculations and lookup look fine, but the results will not display in the columns. Here is the code:
Dim SeatsUsed As Integer = 0
For Each r As DataGridViewRow In DataGridView1.Rows
Try
[code]....