Advertisement
DrAungWinHtut

function basic in CS

Mar 17th, 2022
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.ComponentModel;
  4. using System.Data;
  5. using System.Drawing;
  6. using System.Linq;
  7. using System.Text;
  8. using System.Threading.Tasks;
  9. using System.Windows.Forms;
  10.  
  11. namespace Function_Test
  12. {
  13.     public partial class frmFunctionTest : Form
  14.     {
  15.         public frmFunctionTest()
  16.         {
  17.             InitializeComponent();
  18.         }
  19.  
  20.         private void btnCalculate_Click(object sender, EventArgs e)
  21.         {
  22.             float fR = float.Parse(txtX.Text);
  23.             float fA = funCircleArea (fR);
  24.             float fA2 = funRectArea(3.22f, 54.2f);
  25.         }
  26.  
  27.         public int funY(int iX)
  28.         {
  29.             int iY = 2 * iX;
  30.             return iY;
  31.         }
  32.         public int funYY(int iX)
  33.         {
  34.             int iY = 3 * iX;
  35.             return iY;
  36.         }
  37.  
  38.         public int funYYY(int iX)
  39.         {
  40.             int iY = 4 * iX;
  41.             return iY;
  42.         }
  43.  
  44.         public float funCircleArea(float fRadius)
  45.         {
  46.             float fArea = 3.1415f *  fRadius * fRadius;
  47.             return fArea;
  48.         }
  49.  
  50.         public float funRectArea(float fWidth, float fLength)
  51.         {
  52.             float fArea = fWidth * fLength;
  53.             return fArea;
  54.         }
  55.  
  56.         public void funHello()
  57.         {
  58.             this.Text = "Hello";
  59.         }
  60.  
  61.         private void btnHello_Click(object sender, EventArgs e)
  62.         {
  63.             funHello ();
  64.         }
  65.  
  66.         private void frmFunctionTest_Load(object sender, EventArgs e)
  67.         {
  68.  
  69.         }
  70.     }
  71. }
  72.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement