Tugas 4 PBKK List Name
Nama : Danar Sodik Priyambodo
NRP : 5025211145
PBKK-A
Tugas 4 kali ini membuat aplikasi List Name untuk melakukan List nama yang dimasukkan ke dalam text box, kemudian saat tombol add name di tekan maka, nama yang dimasukkan akan di list di kotak sebelah kiri pada kotak Names, begitu seterusnya saat nama baru di masukkan akan dilakukan list name di bawah nama yang telah dimasukkan sebelumnya.
Berikut Merupakan Source Code XAML dari Aplikasi List Name :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="ListName.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:ListName" | |
mc:Ignorable="d" | |
Title="List Name" Height="180" Width="260"> | |
<Grid Margin="10"> | |
<Grid.RowDefinitions> | |
<RowDefinition Height="Auto" /> | |
<RowDefinition Height="*" /> | |
</Grid.RowDefinitions> | |
<Grid.ColumnDefinitions> | |
<ColumnDefinition Width="*" /> | |
<ColumnDefinition Width="*" /> | |
</Grid.ColumnDefinitions> | |
<Label>Names</Label> | |
<ListBox Grid.Row="1" x:Name="lstNames" /> | |
<StackPanel Grid.Row="1" Grid.Column="1" Margin="5,0,0,0"> | |
<TextBox x:Name="txtName" /> | |
<Button x:Name="btnAdd" Margin="0,5,0,0" Click="ButtonAddName_Click">Add Name</Button> | |
</StackPanel> | |
</Grid> | |
</Window> |
Berikut Merupakan Source Code C Sharp dari Aplikasi List Name :
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; | |
using System.Windows.Media; | |
using System.Windows.Media.Imaging; | |
using System.Windows.Navigation; | |
using System.Windows.Shapes; | |
namespace ListName | |
{ | |
/// <summary> | |
/// Interaction logic for MainWindow.xaml | |
/// </summary> | |
public partial class MainWindow : Window | |
{ | |
public MainWindow() | |
{ | |
InitializeComponent(); | |
} | |
private void ButtonAddName_Click(object sender, RoutedEventArgs e) | |
{ | |
if (!string.IsNullOrWhiteSpace(txtName.Text) && !lstNames.Items.Contains(txtName.Text)) | |
{ | |
lstNames.Items.Add(txtName.Text); | |
txtName.Clear(); | |
} | |
} | |
} | |
} |
Berikut Merupakan ScreenShoot dari aplikasi List Name :
- Tampilan Aplikasi List Name :
- Tampilan Saat Ingin memasukkan nama :
- Tampilan saat berhasil memasukkan list nama pertama :
- Tampilan saat banyak list nama yang berhasil di masukkan :
Project dari aplikasi ini dapat di akses di github : ListName
Komentar
Posting Komentar