Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
xem thử có start SQL server service chưa....
trong phần run--> services.msc ấy
Lỗi nhìu lắm huynh ơi ...Windows 7 có cái ngộ là phải run as administrator thì mới log vô sql được cậu thử lại xem, ý tui nói là right click rồi chọn Run as Administrator
Khi cậu bĩ lỗi như vầy thì hãy vô Manage trong windows để xem log chi tiết
Right Click My Computer chọn manage, chọn tiếp Event Viewer, chọn windows log, sau đó tìm trong security hoặc Application để xem lỗi cụ thể là gì. Nếu không biết cách giải quyết cậu post lên cho tui xem cái log với
Ta bị lờ rồi
......................


C#:
Mình thiết kế 1 cái nút trên 1 form (form A), bấm vào cái nút trên form A đấy thì nó sẽ hiện ra 1 form mới (form B). Vậy mình set thuộc tính cho cái form B như thế nào để nó luôn ở trên cùng, muốn thao tác được trên form A thì phải đóng cửa sổ form B. Giống như cái MessageBox ý
Cái MessageBox hiển thị được ít thông tin quá nên mới phải dùng form![]()


private void button2_Click(object sender, EventArgs e)
{
Form form2 = new Information();
form2.Show();
//this.Deactivate += new System.EventHandler(Form_Deactivate);
}
using System;
using System.Windows.Forms;
using System.Drawing;
class MyWinApp
{
static void Main()
{
// (1) Create form and invoke it
Form mainForm = new FormA();
Application.Run(mainForm);
}
}
// User Form derived from base class Form
class FormA:Form
{
private Button button1;
Form frmB=new FormB();
public FormA() {
this.Text = "Hand Made Form";
button1 = new Button();
button1.Location = new Point(96,112);
button1.Size = new Size(72,24);
button1.Text= "Status";
this.Controls.Add(button1);
button1.Click += new EventHandler(button1_Click);
this.Activated += new System.EventHandler(Form_Activate);
}
void button1_Click(object sender, EventArgs e) {
frmB.Show();
}
void Form_Activate(object sender, EventArgs e)
{
if(frmB.CanFocus){
frmB.Activate();
}
}
}
class FormB:Form
{
public FormB()
{
this.Text="Form B";
this.Deactivate += new System.EventHandler(Form_Deactivate);
}
void Form_Deactivate(object sender, EventArgs e)
{
this.Activate();
}
}
Cho mình hỏi chút về VB. Mình thiết kế 1 cái nút, muốn thực thi 1 hành động khi click vào cái nút đó là chạy 1 file trên 1 đường dẫn cho trước. sau đó close cái cửa sổ đó lại. vậy câu lệnh thế nào?
Cho mình hỏi thêm là 1 chương trình được viết bằng VB thì có khi compile ra exe, copy sang máy khác để chạy thì máy đó có cần Dotnet gì không?
Tks trước
imports Microsoft.VisualBasic
imports System
imports System.Collections.Generic
imports System.Windows.Forms
imports System.IO
public module MyModule
Sub RunSnippet()
Dim OpenFileDialog1 as OpenFileDialog = new OpenFileDialog()
OpenFileDialog1.Multiselect = False
OpenFileDialog1.InitialDirectory = "C:\Program Files"
Dim result As DialogResult = OpenFileDialog1.ShowDialog()
If result = DialogResult.OK Then
System.Diagnostics.Process.Start(OpenFileDialog1.FileName)
End If
OpenFileDialog1.Dispose()
End Sub
#region "Helper methods"
Sub Main()
Try
RunSnippet()
Catch e As Exception
Dim err As String = String.Format("---{0}The following error occurred while executing the snippet:{0}{1}{0}---", vbCrLf, e.ToString())
Console.WriteLine(err)
Finally
Application.Exit()
End Try
End Sub
sub WL(text as object)
Console.WriteLine(text)
end sub
sub WL(text as object, paramarray args as object())
Console.WriteLine(text.ToString(), args)
end sub
sub RL()
Console.ReadLine()
end sub
sub Break()
System.Diagnostics.Debugger.Break()
end sub
#end region
end module
Dim OpenFileDialog1 as OpenFileDialog = new OpenFileDialog()
OpenFileDialog1.Multiselect = False
OpenFileDialog1.InitialDirectory = "C:\Program Files"
Dim result As DialogResult = OpenFileDialog1.ShowDialog()
If result = DialogResult.OK Then
System.Diagnostics.Process.Start(OpenFileDialog1.FileName)
End If
OpenFileDialog1.Dispose()

C#:
Mình thiết kế 1 cái nút trên 1 form (form A), bấm vào cái nút trên form A đấy thì nó sẽ hiện ra 1 form mới (form B). Vậy mình set thuộc tính cho cái form B như thế nào để nó luôn ở trên cùng, muốn thao tác được trên form A thì phải đóng cửa sổ form B. Giống như cái MessageBox ý
Cái MessageBox hiển thị được ít thông tin quá nên mới phải dùng form![]()