|
I have done, but also want to address up on this issue and for all, who needs it to use:
In Form1:
Set the button code below in the form1
Form2 f = new Form2();
if (f.ShowDialog() == DialogResult.OK)
{
}
else
{
}
In form2:
Set the button code below in the form 2
this.DialogResult = DialogResult.Cancel;
|
|
|
|
|
If a dialog wants the caller Form to perform some action, then it normally sets DialogResult to one of the predefined values (but not None nor Cancel), and the caller tests for that value.
Using Cancel and putting the action in the else part of the test is extremely weird. Were you sober when you wrote this?
|
|
|
|
|
The "proper" way to do this is to provide two buttons in Form2, and set their properties appropriately.
The "OK" button has the DialogResult set to Dialogresult.OK
The "Cancel" button has the DialogResult set to Dialogresult.Cancel
The Form has its AcceptButton property set to the OK button, and is CancelButton set to the Cancel Button.
The framework will then handle the buttons without any event handlers being necessary.
These properties can be set at design time.
In fact, I use a OK/Cancel button so often, I have made a VS Template to create it automatically - there is a Tip here which describes how to do it: Create Visual Studio forms for items you frequently use[^]
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
need assistance or information on how to take information found in one class and link it into Program.cs.
It is a menu system, basically I want the user to be able to locate a vehicle (option 1) and when they enter option 1, all the relevant vehicle information is pulled from the vehicle class and displayed.
I need the application to display vehicleMake, vehicleModel, vehicleWeight and vehicleRegNo once option 1 is pressed. If anyone out there would be able to assist me and wants to take a look at the code, please reply in this thread and I will show you the code.
I have my vehicle details inside Program.cs
Say for example myDepots[0].AddVehicle(new Vehicle("Ford", "L9000", "200KG", "123"));
This is an example of 1 vehicle which is at the first depot, what I need the menu to do is when the user chooses option 1 (locate a vehicle), the user will enter "Ford" and the application will then look through the code and display:
"This vehicle is the Ford L9000 which has a capacity of 200KG and the regNo is 123."
If you know what I mean? I can post the actual code if someone is able to help, please bare in mind I'm a C# BEGINNER and am not knowledgeable of complex terms, so if someone is able to help and uses complex programming language, expect me to reply and ask for a more simplified version
Thank you
Rafa
|
|
|
|
|
What type of project? Windows forms, console? Post at least some of the relevant code inside a code tag and I'm sure someone will be able to help.
"You get that on the big jobs."
|
|
|
|
|
Hi to all my fellow C# peeps out there, i have a question regarding profession and compensation.
What should a C# developer with 5+ years experience, that holds 2 diplomas (internationally) in software engineering with a thorough understanding of all language aspects , ORM, Reflection, systems integration, biometrics , serial devices, robotics, Multithreading ASP.NET MVC ect expect to earn.
I know the result should be different depending on the area, and what the job should be but any takers give an amount and basic job descripion it should give me a baseline of what my answer should be. Obviously a experienced developer doing desktop support is not what I am asking.
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
It really depends on who you are as a person. If you're very good, you can expect to earn more than if you just get by.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Not the best forum to discuss this - The Lounge may be a better bet.
|
|
|
|
|
Look in the trade magazines for the area where you live to see what salaries are being offered. Given that you are an unknown quantity to any prospective employer (experience counts a little, diplomas generally count for nothing) you can expect to be paid whatever their estimation is of your worth, and how much they need you. I don't know what it's like in SA just now, but here in the UK there are plenty of experienced developers looking for work.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Yes that is usually the big one, though we have a use amount of recruitment agencies out here, thing is they want a copy of your current payslip and then they use that as a basis of the offer their client will give you , which i quite frankly see as unfair. because like you said the job should be worth the work that you put in.
Though they do advertise for jobs (in my qualification and experience range) roughly 120% more that i am currently worth. though when the recruiter comes to you they generally seem to want to dangle an extra 10% in front of you.
Maybe a change in profession might be in order as I have basically mastered all aspects of my programming language, project management perhaps ?
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
Chona1171 wrote: recruitment agencies
My opinion of these people is not printable in a family forum.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
I am with you on that one, they try and nail you for every cent your have and that you don't have.
It is completely idiotic for someone who is applying for a skilled position to be valuated by someone who most likely haven't even seen a program flowchart in his/her life,
best interviews i ever had was when i applied directly to the company and they had an actual programmer i can talk to.
Chona1171
Web Developer (C#), Silverlight
|
|
|
|
|
Chona1171 wrote: It is completely idiotic for someone who is applying for a skilled position to
be valuated by someone who most likely haven't even seen a program flowchart in
his/her life,
Presumably you mean in terms of skills only.
In terms of salary I would expect that a recruiter would have far more knowledge about what might be reasonable both for an employee and an employer.
|
|
|
|
|
how to make button group in visual c#?
|
|
|
|
|
See this[^] article.
/ravi
|
|
|
|
|
Greetings, everyone! I have a list of Panel controls containing information. Each panel is modeled as a sheet of paper almost like it is in Microsoft Word. There are 55 sheets to be displayed but when I try to show them, only 29 of them are shown. The last sheet that is shown (29th sheet) is positioned such that The Location.Y never goes beyond 32767. The rest of the sheets are therefore not shown on the parent control.
I do think the value 32767 is the highest value for signed 16bit integer. However, the Point Structure for Control Location takes integer values but this does not go beyond that. Is there any other approach to show all the sheets? Thanks in advance.
|
|
|
|
|
You may want to consider setting the panel's AutoScroll [^] property to true in order to view sheets that are outside its visible boundary.
/ravi
|
|
|
|
|
Ravi, AutoScroll is already set to true and Scrollbars appear. During scrolling, I realise that only 29 sheets are drawn with the last sheet location at Y-coordinate 32767. The rest of the sheets to be shown beyond this point are not drawn.
modified 11-Mar-12 4:25am.
|
|
|
|
|
And what would you do when your document had 550 or 5500 pages?
You need a virtual approach; don't have all the pages present all the time, just have the ones you need at any point in time. As a minimum, you could reduce the height of all panels not in the current view (the vertical scroll bar becomes pretty useless anyway when the height exceeds 10000); and at best you would not have all those pages in memory at all.
|
|
|
|
|
Thanks Luc. I think it calls for a redesign. I'm thinking of implementing the scrolling on my own. Then during painting, I draw only those sheets that will be visible. What I'm thinking about now is how to know the particular page of the sheets to be drawn based on the scroll position. I'm thinking of any approach that will avoid Control.Location property. Any idea please?
|
|
|
|
|
I see two ways:
1. use a scrollable-panel-in-panel approach, then look for the VerticalScroll property.
2. use a single Panel plus a Scrollbar, and organize it all yourself.
|
|
|
|
|
How to search multiple images by its contains?
|
|
|
|
|
Sorry, but that doesn't make a lot of sense.
Please, try to give us more information, maybe an example of what you are trying to achieve.
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|
|
hello, please i want code to read and display image in c#
|
|
|
|
|
From where, and to what?
Ideological Purity is no substitute for being able to stick your thumb down a pipe to stop the water
|
|
|
|