ببینید یه داستانی توی ویندوز داریم به اسم GDI تمام این مسایل را ساپورت میکندسلام یه سوال داشتم.
چطور میشه در ویژوال بیسیک ، یک متن رو با تصویر الحاق کرد به این صورت که یه برچسب دارم که روی یک جعبه تصویر قرار گرفته میخوام این تصویر رو جوری ذخیره کنم که متن روی برچسب هم با آن ذخیره بشه و وقتی تصویر ذخیره شده را باز میکنم متن برچسب روی تصویر ذخیره شده باشه.
// Obtain the window's client rectangle
GetClientRect(hwnd, &r); // THE FIX: by setting the background mode
// to transparent, the region is the text itself //
SetBkMode(hdc, TRANSPARENT);
// Bracket begin a path
BeginPath(hdc); // Send some text out into the world
TCHAR text[ ] = "Defenestration can be hazardous";
TextOut(hdc,r.left,r.top,text, ARRAYSIZE(text)); // Bracket end a path
EndPath(hdc); // Derive a region from that path
SelectClipPath(hdc, RGN_AND); // This generates the same result as
SelectClipPath() //
SelectClipRgn(hdc, PathToRegion(hdc)); // Fill the region with grayness
FillRect(hdc, &r, GetStockObject(GRAY_BRUSH));
Public Sub DrawString()
Dim formGraphics As System.Drawing.Graphics = Me.CreateGraphics()
Dim drawString As String = "Sample Text"
Dim drawFont As New System.Drawing.Font("Arial", 16)
Dim drawBrush As New _
System.Drawing.SolidBrush(System.Drawing.Color.Black)
Dim x As Single = 150.0
Dim y As Single = 50.0
Dim drawFormat As New System.Drawing.StringFormat
formGraphics.DrawString(drawString, drawFont, drawBrush, _
x, y, drawFormat)
drawFont.Dispose()
drawBrush.Dispose()
formGraphics.Dispose()
End Sub
Private Sub RenderText1(ByVal e As PaintEventArgs)
TextRenderer.DrawText(e.Graphics, "Regular Text", _
Me.Font, New Point(10, 10), SystemColors.ControlText)
End Sub
می تونین از علامت # استفاده کنین و کد ها رو بین تگ <code> بنویسینببخشید نمی دونم چطوری توی این فرم ها میشه راست نویس چپ نویس توام داشت که کد ها بهم نخورد
End Sub
می تونین از علامت # استفاده کنین و کد ها رو بین تگ <code> بنویسین
ممنون به خاطر اطلاعات خوبتون، استفاده کردیم
Dim Query as string = "Select * FROM Customers"
Dim CnStrng As String = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source =C:\Northwind.mdb"
Dim Cn As New OleDb.OleDbConnection(CnStrng)
Dim da As New OleDb.OleDbDataAdapter(Query, Cn)
Dim dt As New DataTable
Cn.Open()
da.Fill(dt)
من توي سايتي كه گفتين upload كردم اما نمي دونم چطوري بياد اينجا http://www.tinypic.com/pic error errorلينك كنم . لطفا راهنما يي كنيد . نمي دونم اينطوري درسته يا نه ؟
[SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]configuration[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]appSettings[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]/>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]connectionStrings[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]<[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]add[/COLOR][/SIZE][SIZE=2][COLOR=#ff0000]name[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]=[/COLOR][/SIZE][SIZE=2]"My[/SIZE][SIZE=2][COLOR=#0000ff]DataConnectionString[/COLOR][/SIZE][SIZE=2]"[/SIZE][SIZE=2][COLOR=#ff0000]connectionString[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]=[/COLOR][/SIZE][SIZE=2]"[/SIZE][SIZE=2][COLOR=#0000ff]Data Source=COMPUTER\SQLEXPRESS;Initial Catalog=MYData;Integrated Security=True[/COLOR][/SIZE][SIZE=2]"[/SIZE][SIZE=2][COLOR=#ff0000]providerName[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]=[/COLOR][/SIZE][SIZE=2]"[/SIZE][SIZE=2][COLOR=#0000ff]System.Data.SqlClient[/COLOR][/SIZE][SIZE=2]"[/SIZE][SIZE=2][COLOR=#0000ff]/>[/COLOR][/SIZE]
[SIZE=2][COLOR=#0000ff]</[/COLOR][/SIZE][SIZE=2][COLOR=#a31515]connectionStrings[/COLOR][/SIZE][SIZE=2][COLOR=#0000ff]>[/COLOR][/SIZE]
Private Sub OpenSqlConnection() Dim [COLOR=#ffffff]connectionString[/COLOR] As String = GetConnectionString() Using connection As New SqlConnection() connection.[COLOR=#ffffff]ConnectionString[/COLOR] = [COLOR=#ffffff]connectionString[/COLOR] connection.Open() Console.WriteLine("State: {0}", connection.State) Console.WriteLine("[COLOR=#ffffff]ConnectionString[/COLOR]: {0}", _ connection.[COLOR=#ffffff]ConnectionString[/COLOR]) End UsingEnd SubPrivate Function GetConnectionString() As String ' To avoid storing the connection string in your code, ' you can retrieve it from a configuration file. Return "Data Source=MSSQL1;Database=AdventureWorks;" _ & "Integrated Security=true;"End Function/]
سلامسلاممن به صورت فوري و فوتي احتياج به تكه كدي كه از SQL در VB.NET استفاده مي كنه دارمخودم نوشتم ولي توي خط CON.OPEN خطا مي گيره . چرا ؟
Thread starter | عنوان | تالار | پاسخ ها | تاریخ |
---|---|---|---|---|
درخواست نمونه سوال تستی همراه با پاسخ vb.net | VB.NET | 1 | ||
م | نوشتن برنامه ساعت دیجیتال با ویژوال بیسیک | VB.NET | 0 | |
A | درخواست کتاب برنامه نویسی VB مقدماتی | VB.NET | 1 | |
M | برنامه نویسی پورت usb با ویژوال بیسیک | VB.NET | 1 | |
آموزش برنامه نویسی VB.net (بررسی سئوالات و مشکلات) | VB.NET | 5 |