Structural Engineering App - Copy this React, Tailwind Component to your project
Using System; using System.Windows.Forms; namespace StructuralEngineeringApp { public partial class MainForm : Form { public MainForm() { InitializeComponent(); } private void InitializeComponent() { this.Text = "Structural Engineering Application"; this.Size = new System.Drawing.Size(400, 300); this.RightToLeft = RightToLeft.Yes; this.RightToLeftLayout = true; TabControl tabControl = new TabControl(); tabControl.Dock = DockStyle.Fill; TabPage columnAreaTab = new TabPage("Column Area"); TabPage maxLoadTab = new TabPage("Maximum Load"); TabPage beamStressTab = new TabPage("Beam Stress"); TabPage concreteVolumeTab = new TabPage("Concrete Volume"); // Add a new tab tabControl.TabPages.Add(columnAreaTab); tabControl.TabPages.Add(maxLoadTab); tabControl.TabPages.Add(beamStressTab); tabControl.TabPages.Add(concreteVolumeTab); // The previous code for the first three tabs remains unchanged // ... // Adding the new tab for concrete volume calculation TextBox lengthTextBox = new TextBox(); TextBox widthTextBox = new TextBox(); TextBox heightTextBox = new TextBox(); Button calculateVolumeButton = new Button(); Label volumeResultLabel = new Label(); lengthTextBox.Location = new System.Drawing.Point(10, 10); lengthTextBox.Size = new System.Drawing.Size(100, 20); lengthTextBox.PlaceholderText = "Length (m)"; widthTextBox.Location = new System.Drawing.Point(10, 40); widthTextBox.Size = new System.Drawing.Size(100, 20); widthTextBox.PlaceholderText = "Width (m)"; heightTextBox.Location = new System.Drawing.Point(10, 70); heightTextBox.Size = new System.Drawing.Size(100, 20); heightTextBox.PlaceholderText = "Height (m)"; calculateVolumeButton.Location = new System.Drawing.Point(120, 40); calculateVolumeButton.Size = new System.Drawing.Size(100, 23); calculateVolumeButton.Text = "Calculate Volume"; calculateVolumeButton.Click += (sender, e) => { if (double.TryParse(lengthTextBox.Text, out double length) && double.TryParse(widthTextBox.Text, out double width) && double.TryParse(heightTextBox.Text, out double height)) { double volume = length * width * height; volumeResultLabel.Text = $"Concrete Volume: {volume:F2} cubic meters"; } else { volumeResultLabel.Text = "Please enter valid values"; } }; volumeResultLabel.Location = new System.Drawing.Point(10, 100); volumeResultLabel.AutoSize = true; concreteVolumeTab.Controls.Add(lengthTextBox); concreteVolumeTab.Controls.Add(widthTextBox); concreteVolumeTab.Controls.Add(heightTextBox); concreteVolumeTab.Controls.Add(calculateVolumeButton); concreteVolumeTab.Controls.Add(volumeResultLabel); this.Controls.Add(tabControl); } [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new MainForm()); } } }
