TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
D Lng
NA
12
4.9k
Click Button causes App to exit?
Jan 5 2012 2:44 PM
Hi,
I have pasted some code below for two button actions to perform a calculation, the first button action causes the app to exit in the emulator, the second button action works good.
Any ideas please?
Thank you.
Code:
namespace WindowsPhoneApplication11
{
public partial class PanoramaPage1 : PhoneApplicationPage
{
public PanoramaPage1()
{
InitializeComponent();
}
// This button action crashes the app
private void btnGetAvail_Click(object sender, RoutedEventArgs e)
{
var compdown = Convert.ToDouble(tbundown) - Convert.ToDouble(tbplandown);
var shiftact = Convert.ToDouble(tbshift);
var not = shiftact - compdown;
var avail = not / shiftact * 100;
var availr = Math.Round(avail,2);
tbAvail.Text = availr + "%";
}
// This button action works good.
private void btnGetOEE_Click(object sender, RoutedEventArgs e)
{
//var total = Convert.ToDouble(tbYield.Text) * Convert.ToDouble(tbAvailability.Text) * Convert.ToDouble(tbPerformance.Text)* 100;
var total = Convert.ToDouble(tbYield.Text) * Convert.ToDouble(tbAvailability.Text) * Convert.ToDouble(tbPerformance.Text)* 100;
var rounded = Math.Round(total,2);
tbOEE.Text = rounded + "%";
}
}
}
Reply
Answers (
7
)
How to resize the silverlight datagrid to associate with maximum and minimum size of Internet Explorer 8
How to handle Thread in c# ?