|
Hi,
You already know everything? Wat do we need to tell u?
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
I have a form with no border, how do I code it so that the end user can still drag it around the desktop?
|
|
|
|
|
Hi,
you need to implement your own drag/drop for this.
try the following code
<br />
'Declare vars<br />
Private CurX As Double<br />
Private CurY As Double<br />
<br />
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseMove<br />
<br />
If e.Button = MouseButtons.Left Then 'use mouse_left_button<br />
Dim pt As Point<br />
pt.X = Me.Left + (e.X - CurX)<br />
pt.Y = Me.Top + (e.Y - CurY)<br />
Me.Location = pt<br />
Me.Refresh()<br />
End If<br />
<br />
End Sub<br />
<br />
Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles MyBase.MouseDown<br />
CurX = e.X<br />
CurY = e.Y<br />
End Sub<br />
Above is a simple drag/drop implemented using mouse move and mouse down events
Mubashir
Every job is a self portrait of the person who did it.
|
|
|
|
|
Private Sub SetPoint()<br />
If hdMousedown = True Then hdMousedown = False Else hdMousedown = True<br />
pt = Me.PointToClient(Control.MousePosition)<br />
End Sub<br />
<br />
Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseDown<br />
SetPoint()<br />
End Sub<br />
<br />
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseUp<br />
SetPoint()<br />
End Sub<br />
<br />
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseMove<br />
If hdMousedown = True Then<br />
Me.Location = New Point(Control.MousePosition.X - pt.X, Control.MousePosition.Y - pt.Y)<br />
End If<br />
End Sub
Posted by The ANZAC
|
|
|
|
|
i have a problem with my printer, i wanted to send an esc/pos command to the printer but i dont know how to send it to LPT port through vb, can someone help with this? thanks before...
Audrey
|
|
|
|
|
You're looking for this[^] example. WHo would have thought sending data directly to an LPT port would be so complicated.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
wuih..... huh.... thanks for the article... i'll try to read it... hopefully understand it... but anyway thanks
Audrey
|
|
|
|
|
Sir/Madam,
Can I programically ascertain , the number of users who has accounts on my operation system
I can find out the user who is currently logged in .
By the following code.
System.Environment.Username
But I want to know the no of users who has account on the operation system.
Please help.
Thanks and Regards
Pankaj
|
|
|
|
|
Hi if i select month and year based on that...,
i need that month all dates in my datagrid...,
Plz help me...,
Magi
|
|
|
|
|
if you want dates of a month in a column just for first date of month as
dim date as new date(yyyy,mm,dd)
i.e. dim ldtFirst as new date(2007,04,01) - for april
and loop through the ldtFirst.DaysInMonth - gives total number of days in the current month, add the rows in the datagrid
Milan
|
|
|
|
|
plz tell me in loop what condition we want to give...,
I am new in this..,
Plz send some sample code...,
then it will be usefull for me....,
Magi
|
|
|
|
|
in this way...........
Private Sub LoadDates()
Dim dt As New DataTable
Dim dr As DataRow
Dim lIntIndex As Integer
Dim lIntDysInMonth As Integer
Dim curDate As New Date(2007, 4, 1)
lIntDysInMonth = Date.DaysInMonth(2007, 4)
dt.Columns.Add("dates")
For lIntIndex = 1 To lIntDysInMonth
dr = dt.NewRow
dr.Item(0) = curDate.ToShortDateString
curDate = curDate.AddDays(1)
dt.Rows.Add(dr)
Next
DataGrid1.DataSource = dt
End Sub
Milan
|
|
|
|
|
thank u friend.....,
Magi
|
|
|
|
|
Hi All,
I am working on a project which is like LAN messenger. I am new to Sockets in .NET. Could anyone help me with a simple example.
|
|
|
|
|
Hi All,
I have a bit of a newbie question I cant seem to figure out. I am using VB 2005 Express.
I want to change the size of paper to A5 during, but the kind property is read only
If there is a log then print A4 if not print A5.
I use VBMySQLiect to get data from a MySQL database.
My Code:
<br />
Private Sub btnPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrint.Click<br />
SQL = "select * from clients where id = '" & lvwList.SelectedItems.Item(0).Text & "'"<br />
For i = 2 To lvwList.SelectedItems.Count<br />
SQL = SQL & " or id = '" & lvwList.SelectedItems.Item(i - 1).Text & "'"<br />
Next<br />
rs = gCnn.Execute(SQL)<br />
With prnPreview<br />
.Document = prnDocument<br />
If bLog Then<br />
.Document.DefaultPageSettings.PaperSize.Kind = Printing.PaperKind.A5<br />
Else<br />
.Document.DefaultPageSettings.PaperSize.Kind = Printing.PaperKind.A4<br />
End If<br />
.ShowDialog()<br />
End With<br />
End Sub<br />
What do I need to do?
Thank you
Andrew
|
|
|
|
|
i want unmovable running form
what i do
|
|
|
|
|
give 'None' as its border style
|
|
|
|
|
there is not border style
pls help me
|
|
|
|
|
He's talking about the Form's BorderStyle property. Set it to None and there won't be any method for the user to move the form from where it appears.
Dave Kreskowiak
Microsoft MVP
Visual Developer - Visual Basic 2006, 2007
|
|
|
|
|
yes i understood
i was select form and search it's border style property, it's nothing
it also not done by code as me.borderstyle=none
|
|
|
|
|
it is FormBorderStyle property- check it out
|
|
|
|
|
Yes
it is working thank you
|
|
|
|
|
WELCOME
|
|
|
|
|
Hi,
I need to convert this coding VB 5.0 to VB.Net 2003. This print button coding in billing system. I use BIXOLON SAMSUNG SRP-275 mini printer. There was sample coding but it's in VB 5.0. But I write my program in VB.Net 2003.
This is the coding......
'//////////////////////////////////////////////////////////////////
Private Sub Command1_Click()
For Each prnPrinter In Printers
If prnPrinter.DeviceName = "BIXOLON SAMSUNG SRP-275" Then
Set Printer = prnPrinter
Exit For
End If
Next
If Printer.DeviceName = "BIXOLON SAMSUNG SRP-275" Then
Printer.Font.Size = 9
Printer.FontName = "FontControl"
Printer.Print "x"
Printer.Font.Size = 9
Printer.FontName = "FontA2x1"
Printer.Font.Bold = True
Printer.Print "* Joshua Cafe *" + vbCrLf
Printer.Font.Bold = False
Printer.Font.Size = 9
Printer.FontName = "FontControl"
Printer.Print "w"
Printer.Font.Size = 9
Printer.FontName = "FontA1x1"
Printer.Print " 3000 Spring Street, Rancho,"
Printer.Print " California 10093,"
Printer.Print " Tel) 858-519-3698 Fax) 3852"
Printer.Print vbCrLf + "---------------------------------" 'LF
Printer.Print "Orange Juice 5.00"
Printer.Print "6 Bufalo Wing 24.00"
Printer.Print "Potato Skin 12.00"
Printer.Font.Bold = True
Printer.ForeColor = RGB(255, 0, 0)
Printer.Print "Subtotal 41.00"
Printer.ForeColor = RGB(0, 0, 0)
Printer.Font.Bold = False
Printer.Print "Tax 6% 2.46"
Printer.Font.Bold = True
Printer.ForeColor = RGB(255, 0, 0)
Printer.Print "Member Discount 2.30"
Printer.ForeColor = RGB(0, 0, 0)
Printer.Font.Bold = False
Printer.Font.Bold = True
Printer.Print "Cash 100.00"
Printer.Print "Amt. Paid 41.16"
Printer.Font.Bold = False
Printer.Font.Bold = True
Printer.ForeColor = RGB(255, 0, 0)
Printer.Print "Change Due 58.84"
Printer.ForeColor = RGB(0, 0, 0)
Printer.Font.Bold = False
Printer.Print "---------------------------------"
Printer.Font.Size = 9
Printer.FontName = "FontControl"
Printer.Print "x"
Printer.Font.Size = 9
Printer.FontName = "FontA1x1"
Printer.Print "Member Number : 452331949" + vbCrLf
Printer.Font.Size = 9
Printer.FontName = "FontA1x1"
Printer.Font.Bold = True
Printer.Print "Have a nice day !" + vbCrLf
Printer.Font.Bold = False
Printer.Print "Sale Date: 07/01/03"
Printer.Print "Time: 12:30:45"
Printer.Font.Size = 9
Printer.FontName = "FontControl"
Printer.Print "w"
Dim pic As Picture
Set pic = LoadPicture(App.Path & "\free5_100.bmp")
Printer.CurrentX = 60
Printer.CurrentY = 5000
Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY
Printer.CurrentY = Printer.CurrentY + pic.Height
Set pic = LoadPicture(App.Path & "\cafeblue208.bmp")
Printer.PaintPicture pic, Printer.CurrentX, Printer.CurrentY
Printer.CurrentX = 0
Printer.CurrentY = 9000
Printer.Font.Size = 9
Printer.Font.Name = "FontControl"
Printer.Print "g"
Printer.EndDoc
Else
MsgBox "SRP-270 windows driver don't installed"
End If
End Sub
'///////////////////////////////////////////////////////////////////////
Pls help me to solve this problum
Regards
Kusal
|
|
|
|
|
Do you have access to VB 6? If so then you could try creating a VB 6 version and then using the VB conversion Wizard in VB .NET to convert from VB 6 to VB .NET. It probably won't give perfect results but it will be a start. You can then correct the problematic bits by hand.
Kevin
|
|
|
|