|
If you were familiar with the range of HTC's projects, and her competencies ...
You would have to find another way to troll.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
More than you apparently; HTC is using C++.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
Any idea why the standard:
Form2.Show()
wouldn't be working for me? I'm trying to link a menu button to another form.
|
|
|
|
|
It doesn't like you?
Seriously. How could anybody guess why it's "not working" when you have provided no details whatsoever?
And "not working" is not a proper description of a problem.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I am attempting to link a form to a menu button. The button is an "about" for the app, named FormAbout.
<
private void menAbout_Click(object sender, EventArgs e)
{
FormAbout formabout = new FormAbout();
FormAbout.Show();
}
this is my latest attempt. Still brings up an error:
Severity Code Description Project File Line Suppression State
Error CS0120 An object reference is required for the non-static field, method, or property 'Control.Show()' StraightlineDepreciationCalculator C:\Users\koval\source\repos\StraightlineDepreciationCalculator\StraightlineDepreciationCalculator\Straightline Depreciation Calculator.cs 208 Active
|
|
|
|
|
Good. the answer is easy.
You are calling Show on the wrong name. You are calling it on FormAbout when you need to be calling it on formabout.
FormAbout is the type name. formabout is the instance name.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Thanks, I knew it had to be something easy. Spent way to much time on that, lol. Doing my best as a beginner.
|
|
|
|
|
If it starts with a capital letter, you're probably accessing a class name instead of an (local) object instance.
(For the Troll, that assumes one has naming standards).
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
modified 23-Jun-21 12:21pm.
|
|
|
|
|
Thank you for clearing that up for me.
|
|
|
|
|
Hey guys,
As a beginner I'm going through exercises to try an learn the basics of C#. This exercise calls for a straightline depreciation to be calculated with user entering inputs for present value, salvage value, and years of depreciation. I'm stuck at this point and don't know how I should proceed -- if anyone can review and provide me with some direction it would be appreciated!
<
namespace StraightlineDepreciationCalculator
{
public partial class frmStraightlinedDepreciationCalculator : Form
{
public frmStraightlinedDepreciationCalculator()
{
InitializeComponent();
}
private void btnClear_Click(object sender, EventArgs e)
{
txtPresentValue.Text = "";
txtSalvageValue.Text = "";
txtYearsOfDepreciation.Text = "";
txtDisplay.Text = "";
txtPresentValue.SelectAll();
txtPresentValue.Select();
}
private void btnExit_Click(object sender, EventArgs e)
{
DialogResult dlgresult;
dlgresult = MessageBox.Show("Do you want to exit the application?", "Close the form", MessageBoxButtons.YesNo);
if (dlgresult == DialogResult.Yes)
{
System.Environment.Exit(1);
}
else
{
txtPresentValue.Select();
}
}
private void btnCalculate_Click(object sender, EventArgs e)
{
double dblPresentValue = 0;
double dblSalvageValue = 0;
int intYearsOfDepreciation = 0;
int intCounter = 0;
string strDisplay = "";
txtDisplay.Text = "";
dblPresentValue = Convert.ToDouble(txtPresentValue.Text);
dblSalvageValue = Convert.ToDouble(txtSalvageValue.Text);
intYearsOfDepreciation = Convert.ToInt32(txtYearsOfDepreciation.Text);
if (dblPresentValue < 1 | dblPresentValue > 1000000)
{
MessageBox.Show("Present value must be between $1 and $1,000,000");
txtPresentValue.Select();
txtPresentValue.SelectAll();
}
else if (dblSalvageValue > dblPresentValue)
{
MessageBox.Show("Salvage value cannot be greater than Present Value");
txtSalvageValue.Select();
txtSalvageValue.SelectAll();
}
else if (intYearsOfDepreciation < 0 | intYearsOfDepreciation > 25)
{
MessageBox.Show("Years of Depreciation must be in 1 - 25 range");
txtYearsOfDepreciation.Select();
txtYearsOfDepreciation.SelectAll();
}
else
{
strDisplay = "Year Asset Value/r/n------- ---------------";
}
}
}
}
|
|
|
|
|
What do you need help with?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
getting a proper straightline depreciation calculation + display. I'm stuck, not sure where to go from here.
|
|
|
|
|
Well, do you know what "straight line depreciation" is?
How do you work it out manually?
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Getting it to work this way, just need to display as currency now. Thanks for looking.
<
strDisplay = "Year Asset Value\r\n------- ---------------";
double period = (dblPresentValue - dblSalvageValue)/intYearsOfDepreciation;
int curYear = DateTime.Now.Year;
while (intCounter < intYearsOfDepreciation)
{
strDisplay += "\r\n"+ curYear.ToString() + ": " + dblPresentValue.ToString();
intCounter = intCounter + 1;
dblPresentValue -= period;
curYear++;
}
txtDisplay.Text = strDisplay;
|
|
|
|
|
Are you trying to display the end result and what does this show.
Member 15248867 wrote: txtDisplay.Text = strDisplay;
Or do you want to display each iteration, in which case you need to use a listview for display.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Depreciation is a declining balance calculation; the amount depreciated is higher in the first years than the last. The difference between principal and salvage represents a capital gain or loss.
If the principal is 100 and depreciation is 20%, then:
year 1: 100 @ 20% = 20 and 80 (depreciation and remaining principal)
year 2: 80 @ 20% = 16 and 64
year 3: etc.
It was only in wine that he laid down no limit for himself, but he did not allow himself to be confused by it.
― Confucian Analects: Rules of Confucius about his food
|
|
|
|
|
I had assumed that ThenBy had to be executed immediately on the result of an OrderBy call.
I found out that is incorrect: as long as you call ThenBy on an IOrderedEnumerable<T> ... and, of course, you have your argument types correct ... it will perform as expected.
This is useful to me in an Extension I am working on where run-time parameters may determine if a ThenBy is used; may it be useful to you :")
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 21-Jun-21 8:33am.
|
|
|
|
|
As far as I can see, the LINQ ThenBy extension method only works if the argument type is IOrderedEnumerable<T> or IOrderedQueryable<T> . If you try to call it on an IEnumerable<T> or IQueryable<T> , you'll get a CS1061 compiler error even if the run-time type is an ordered enumerable/query.
Enumerable.ThenBy Method (System.Linq) | Microsoft Docs[^]
Queryable.ThenBy Method (System.Linq) | Microsoft Docs[^]
So these will work:
IEnumerable<T> source = ...;
IOrderedEnumerable<T> result = source.OrderBy(x => x.Foo).ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> sorted = source.OrderBy(x => x.Foo);
IOrderedEnumerable<T> result = sorted.ThenBy(x => x.Bar); But these will not:
IEnumerable<T> source = ...;
IOrderedEnumerable<T> result = source.OrderBy(x => x.Foo).Where(x => x.IsActive).ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> sorted = source.OrderBy(x => x.Foo);
IOrderedEnumerable<T> result = sorted.Where(x => x.IsActive).ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> result = source.OrderBy(x => x.Foo).AsEnumerable().ThenBy(x => x.Bar);
IEnumerable<T> source = ...;
IOrderedEnumerable<T> sorted = source.OrderBy(x => x.Foo);
IOrderedEnumerable<T> result = sorted.AsEnumerable().ThenBy(x => x.Bar); Of course, if you're using reflection or the LINQ Expressions API, then a call to ThenBy should work, so long as the parameter has the correct run-time type.
"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer
|
|
|
|
|
Wonderful, Richard, during a recreational=reading break just now, I realized I should have written IEnumerableOrdered; coming back to edit/correct my post, I found your response.Richard Deeming wrote: using reflection or the LINQ Expressions API I'd enjoy seeing some examples of these usages.
If only I could read your mind as well as you can read my mind my code
cheers, Bill
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
modified 21-Jun-21 10:30am.
|
|
|
|
|
how do I get connect to pool for getting jobs( hash buzzle )
I need just to connect to the pool please ?
its socket connection .
I tried that but not getting god result ?
|
|
|
|
|
I can't - but then, the question makes absolutely no sense to me at all ... remember, we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with.
So stop trying to type as little as possible and tell us what you are trying to do; what you tried; what happened when your tried it; what you tried to fix that.
And most important of all, what help you need from us!
Help us to help you!
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Holding the hash buzzle high overhead, go into the stratum 1 pool until the water is at your neck level.
Then, feel with your foot until you touch the buzzle socket.
Tap with foot three times on the socket.
Take a deep breath, dive, place the hash on the buzzle.
Surface and swim quickly away.
Repeat for stratum 2.
«One day it will have to be officially admitted that what we have christened reality is an even greater illusion than the world of dreams.» Salvador Dali
|
|
|
|
|
Hello, I have a problem with my application when printing with the report viewer, when I start printing with the (print) button with preview in the report viewer everything is fine. But for when I run the print without preview with the printToPrinter class there is a rectangle that appears and the sheet limit does not stop the letter (s) if limited. Please if anyone has any idea help me how to configure the page size. I am using a roll paper thermal printer
Here are the images of the invoices https://www.cjoint.com/c/KFsoQyiepMt
|
|
|
|
|
The user shall be able to choose whether to buy a vehicle. If the user selects to buy a vehicle, the user shall be required to enter the following values
for vehicle financing:
a. Model and make.
b. Purchase price.
c. Total deposit.
d. Interest rate (percentage).
e. Estimated insurance premium.
The software shall calculate the total monthly cost of buying the car (insurance plus loan
repayment). Assume that all cars will be repaid over a period of five years. The software shall notify the user when the total expenses, including loan repayments,
exceed 75% of their income. Display the expenses to the user in descending order by value.
|
|
|
|
|
While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.
So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.
If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
"I have no idea what I did, but I'm taking full credit for it." - ThisOldTony
"Common sense is so rare these days, it should be classified as a super power" - Random T-shirt
AntiTwitter: @DalekDave is now a follower!
|
|
|
|