Skip to content

Instantly share code, notes, and snippets.

View nhoxbypass's full-sized avatar
🐧
I come from Earth

Tam H. Doan nhoxbypass

🐧
I come from Earth
View GitHub Profile
private void button1_Click(object sender, EventArgs e)
{
// Show hộp thoại open file ra
// Nhận kết quả trả về qua biến kiểu DialogResult
DialogResult result = openFileDialog1.ShowDialog();
//Kiểm tra xem người dùng đã chọn file chưa
if(result == DialogResult.OK)
{
// Gán ....
private void Form1_Load(object sender, EventArgs e)
{
// Chèn ảnh từ ổ cứng trực tiếp bằng thuộc tính ImageLocation
// Thiết lập thuộc tính Size một cách tự động
pictureBox1.ImageLocation = "BeigeMonitor1.png";
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
}
private void Form1_Load(object sender, EventArgs e)
{
// Lấy file ảnh từ ổ cứng
// File ảnh phải có trong thư mục debug của solution
// Nếu không chương trình sẽ bị crash vì không tìm thấy file
// Có thể để đường dẫn tuyệt đối đến file ảnh
//(bao gồm cả ổ đĩa, thư mục,...)
Image image = Image.FromFile("BeigeMonitor1.png");
// Thiết lập thuộc tính của PictureBox
// access modifiers, accessors và constructors được bỏ qua cho ngắn gọn
class IceTeaVietDeveloper implements Parcelable {
String name;
int yearsOfExperience;
List skillSet;
float favoriteFloat;
IceTeaVietDeveloper(Parcel in) {
this.name = in.readString();
// access modifiers, accessors và constructors được bỏ qua cho ngắn gọn
public class HCMUSDeveloper implements Serializable
String name;
int yearsOfExperience;
List skillSet;
float favoriteFloat;
static class Skill implements Serializable {
String name;
sourceSets {
main {
res.srcDirs = ['src/main/res',
'src/main/res/layouts/chat',
'src/main/res/layouts/home',
'src/main/res/layouts/profile'
]
}
}
class Base
{
public Base()
{
Console.WriteLine("Base 0 constructor called");
}
public Base(int i)
{
Console.WriteLine("Base " + i + " constructor called");
class Base
{
public Base()
{
Console.WriteLine("Base 0 constructor called");
}
}
class Child : Base
{
<Button
android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/check"/>
<Button
android:id="@id/check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
<Button
android:id="@+id/check"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
/>
<Button
android:id="@+id/start"
android:layout_width="wrap_content"
android:layout_height="wrap_content"