|
(via Instant VB):
If Not OnSchedulerEventEvent Is Nothing Then
note the extra 'Event' - accesses the hidden VB <event>Event variable.
Instant VB is the only C# to VB converter that takes into account hidden VB fields such as <event>Event.
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Instant Python: C# to Python converter, VB to Python converter
|
|
|
|
|
Hi,
Pls I wrote a program and my backend is MSSQL server 2000 on pc1 and I want my 3 other pcs to run my program via the network.
Ho can I achieve this.
Fikunmi Feyijin
Hicad Systems
Nigeria
|
|
|
|
|
what is the application u have developed .if it is a web based then u can make ur system as server and u can run from client machine by connecting to the server
|
|
|
|
|
Hi,
I need to store the controls backcolor in DB, and on reload, again i need to get color from DB and set as controls backcolor.
How do i convert the system.drawing.color.green to string "Green" and vice versa.
Any luck.
Be simple and Be sample.
|
|
|
|
|
Hey, Got the answer,
I have done using the followin two functions to do that,
Public Function GetColorToString(ByVal colorObj As System.Drawing.Color) As String
Dim hexString As String
hexString = "#" & Strings.Right("0" & Hex(colorObj.R), 2) & _
Strings.Right("0" & Hex(colorObj.G), 2) & _
Strings.Right("0" & Hex(colorObj.B), 2)
Return hexString
End Function
Public Function GetColorFromString(ByVal strColor As String) As System.Drawing.Color
If Not strColor Is Nothing Then
Dim colConvert As New ColorConverter
Return colConvert.ConvertFromString(strColor)
End If
End Function
It's working for me.
Be simple and Be sample.
|
|
|
|
|
Nah, don't waste time to write a function just get the control color and convert it to string.
<br />
sub getcolorstr()<br />
dim color as string<br />
color = (control name).backcolor.tostring<br />
end sub
that's done!
|
|
|
|
|
i am a new programmer working in this field
i want to read mdb file(ms access) ..
so can u please give me the code regarding this or help me in doing this
|
|
|
|
|
There are so many ways of doing this. You might find it more useful reading up on ADO.NET and working out which way is best for your application.
|
|
|
|
|
I would like be able to open up a .jpg file from the open file dialog and then have the selected picture appear in a picture box, for submitting to a database at a later stage. Is this easily done?
This is what i have so far, and am a small bit confused as to where to go!
Dim OpenFileDialog As New OpenFileDialog<br />
OpenFileDialog.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments<br />
OpenFileDialog.Filter = "Image files (*.jpg)|*.jpg|"<br />
If (OpenFileDialog.ShowDialog(Me) = System.Windows.Forms.DialogResult.OK) Then<br />
'what do i need to do from here???<br />
<br />
End If<br />
Thanks
|
|
|
|
|
pictureBox.Image = Image.FromFile(
OpenFileDialog.FilePath)<br />
<br />
Something like that<br />
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
Don't forget to clear previous image, and there's no filepath property in the openfiledialog, remember that. So use filename instead.
pictbox.Image = Nothing<br />
pictbox.Image = image.fromfile(openfiledialog.filename)
|
|
|
|
|
I was wondering if anyone knows how I can create a DB Job and schedule it to run automatically at reqular intervals, from VB .NET code. I am trying to write an application side interface to the scheduling system that is available in the MSSQL Server 2005, SQL Agent.
I have been looking for information on this for awhile now and anyhelp would be much appreciated.
Thanks.
|
|
|
|
|
Hi,
I want to change the back color of selected date in monthcalander.
Thanks in advance.
|
|
|
|
|
Help me.
How can i print a word document (e.g. one.doc) by clicking on a Click event of a Button in VB.Net ?
Annu Yadav
|
|
|
|
|
|
You can use this, and change the filepath as you need:
<br />
Private printFont As Font<br />
Private streamToPrint As StreamReader<br />
Private Shared filePath As String<br />
--------------------------------------------------<br />
' The PrintPage event is raised for each page to be printed.<br />
Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs)<br />
Dim linesPerPage As Single = 0<br />
Dim yPos As Single = 0<br />
Dim count As Integer = 0<br />
Dim leftMargin As Single = ev.MarginBounds.Left<br />
Dim topMargin As Single = ev.MarginBounds.Top<br />
Dim line As String = Nothing<br />
<br />
' Calculate the number of lines per page.<br />
linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics)<br />
<br />
' Iterate over the file, printing each line.<br />
While count < linesPerPage<br />
line = streamToPrint.ReadLine()<br />
If line Is Nothing Then<br />
Exit While<br />
End If<br />
yPos = topMargin + count * printFont.GetHeight(ev.Graphics)<br />
ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _<br />
yPos, New StringFormat())<br />
count += 1<br />
End While<br />
<br />
' If more lines exist, print another page.<br />
If Not (line Is Nothing) Then<br />
ev.HasMorePages = True<br />
Else<br />
ev.HasMorePages = False<br />
End If<br />
End Sub<br />
------------------------------------------<br />
' Print the file.<br />
Public Sub Printing()<br />
Try<br />
streamToPrint = New StreamReader(app_path & "\data.txt")<br />
Try<br />
printFont = New Font("Arial", 10)<br />
Dim pd As New PrintDocument()<br />
AddHandler pd.PrintPage, AddressOf pd_PrintPage<br />
' Print the document.<br />
pd.Print()<br />
Finally<br />
streamToPrint.Close()<br />
End Try<br />
Catch ex As Exception<br />
MessageBox.Show(ex.Message)<br />
End Try<br />
End Sub 'Printing <br />
<br />
' This is the main entry point for the application.<br />
Public Shared Sub Main()<br />
Dim args() As String = System.Environment.GetCommandLineArgs()<br />
Dim sampleName As String = args(0)<br />
If args.Length <> 1 Then<br />
Console.WriteLine("Usage: " & sampleName & " <file path>")<br />
Return<br />
End If<br />
filePath = args(0)<br />
End Sub<br />
add to your click event this:
Private Sub btnprint_click(byval sender as object, byval e as system.eventargs) handles btnprint.click<br />
printing()<br />
End Sub
|
|
|
|
|
hi,
can any one help me in accessing the word document and modify some content in the word document through vb
|
|
|
|
|
|
hi deepak,
it was a good link . but i not able to see the code .please give me some other links or details
|
|
|
|
|
Hello guys,
Can anyone provide me with a source code to open and read a data from an excel file and then write it in a another excel file. Thanx in advance!!
|
|
|
|
|
You can control Excel using the Microsoft Office Toolkit, or you can read/write csv files, which Excel can read/write
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
|
Hello
I started to edit my old vb.net - windows program. I could not cut,copy,paste,delete anything ( button, panel, label) on windows form. I can add for example a new button but can not delete it ?? If I start a new project everything works. How to get my old project editable again? I use Vb.net 2003 std.
|
|
|
|
|
Is the file read only ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|