Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
I

IqbalVB

@IqbalVB
About
Posts
14
Topics
2
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • How I Can Print a File ?
    I IqbalVB

    You can use this, and change the filepath as you need: Private printFont As Font Private streamToPrint As StreamReader Private Shared filePath As String -------------------------------------------------- ' The PrintPage event is raised for each page to be printed. Private Sub pd_PrintPage(ByVal sender As Object, ByVal ev As PrintPageEventArgs) Dim linesPerPage As Single = 0 Dim yPos As Single = 0 Dim count As Integer = 0 Dim leftMargin As Single = ev.MarginBounds.Left Dim topMargin As Single = ev.MarginBounds.Top Dim line As String = Nothing ' Calculate the number of lines per page. linesPerPage = ev.MarginBounds.Height / printFont.GetHeight(ev.Graphics) ' Iterate over the file, printing each line. While count < linesPerPage line = streamToPrint.ReadLine() If line Is Nothing Then Exit While End If yPos = topMargin + count * printFont.GetHeight(ev.Graphics) ev.Graphics.DrawString(line, printFont, Brushes.Black, leftMargin, _ yPos, New StringFormat()) count += 1 End While ' If more lines exist, print another page. If Not (line Is Nothing) Then ev.HasMorePages = True Else ev.HasMorePages = False End If End Sub ------------------------------------------ ' Print the file. Public Sub Printing() Try streamToPrint = New StreamReader(app_path & "\data.txt") Try printFont = New Font("Arial", 10) Dim pd As New PrintDocument() AddHandler pd.PrintPage, AddressOf pd_PrintPage ' Print the document. pd.Print() Finally streamToPrint.Close() End Try Catch ex As Exception MessageBox.Show(ex.Message) End Try End Sub 'Printing ' This is the main entry point for the application. Public Shared Sub Main() Dim args() As String = System.Environment.GetCommandLineArgs() Dim sampleName As String = args(0) If args.Length <> 1 Then Console.WriteLine("Usage: " & sampleName & " ") Return End If filePath = args(0) End Sub add to your click event this: Private Sub btnprint_click(byval sender as object, byval

    Visual Basic question csharp help

  • How do i get an image to appear in a picture box using the open file dialog??
    I IqbalVB

    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 pictbox.Image = image.fromfile(openfiledialog.filename)

    Visual Basic question database

  • How to convert system.drawing.color to string and vice versa?
    I IqbalVB

    Nah, don't waste time to write a function just get the control color and convert it to string. sub getcolorstr() dim color as string color = (control name).backcolor.tostring end sub that's done! :)

    Visual Basic question database graphics tutorial

  • Is this possible???????
    I IqbalVB

    If you want to transparent an image with transparencykey, dont set the form backcolor to same as the transparencykey, because only the form will be transparent. And also check whether the image color you want to transparent same as the transparencykey. Sorry on bad english too.:laugh: Experience is the best teacher

    Visual Basic csharp com question

  • How to play MP3 file
    I IqbalVB

    Does anyone know how can i play a MP3 file or other multimedia file?, because in the vb we can only play wav file

    Visual Basic question tutorial

  • please help me, change font of windows system
    I IqbalVB

    Do you want to do it programmatically or manually? If you want to do it manually, you can change the appereance in display settings. - Go to Control Panel -> Display. - Klik apppereance tab and then change it as you like. if you want to program it you had to change the value in the registry by using registry object and set the value as you like.

    Visual Basic help

  • How to disable PrintScreen button
    I IqbalVB

    You can unplug the keyboard cable, or don't press the prinscreen button. Ha ha that's a joke. Actually, you can handle it by add some action like showing a message when user press it and delete the image file from picture taken, by this:Private Sub formname_keydown(Byval sender as object, byval e as system.keycode) If e.keycode=key.printscreen = true then msgbox("Sorry, you can't print the screen for a reason","Warning",vbcritical) system.clipboard.clear End If End Sub

    Visual Basic tutorial

  • VB2005 Question.......? [modified]
    I IqbalVB

    Ok then, if you want to do so, these are the way: - set the accepttab property of the textbox into False. - And also set the acceptreturn property into false, too - Add a code that move the focus into another control, like a cancel button when user click on the textbox. PS: You can't avoid backcolor and forecolor of the textbox changed while the control is disabled. If you don't want it, so don't disable the textbox. Experience is the best teacher

    Visual Basic help question

  • login page in vb.net
    I IqbalVB

    you can use redirect method after the page check the username and password. <% bla bla blabla bla . . response.redirect %>

    Visual Basic csharp tutorial question

  • VB Decompiler?
    I IqbalVB

    You can try to read the ansi character if you want to get dizzy. Why don't you make the decompiling program by yourself

    Visual Basic help question

  • How to clear Datagridview
    I IqbalVB

    The code will not working because it's read only. By the way, if you use bounded data you can't clear it. But if you use typed data you can clear the collection with this: Private Sub btnClearALL_Click(Byval sender as object, Byval e as System.Eventargs) Handles btnClearAll.Click datagrid1.rows.clear End Sub Exprience is the best teacher

    Visual Basic csharp tutorial

  • couldn't open
    I IqbalVB

    Have you check the code? there are maybe some mistyped word or the code version are not same as your compiler. If it's a vb 6.0 code and you use vb2005 you can upgrade the code using upgrade tool.

    Visual Basic help

  • how to read delimited text and store it into array
    I IqbalVB

    I want to make a simple dictionary application that read the source from a delimited file, like using tab or comma and then store it into an array. I've tried using snippets, but it isn't working and doesn't look like what I want. Please help me to make the code Thanks 0011000011000001010101110100

    Visual Basic data-structures help tutorial

  • VB2005 Question.......? [modified]
    I IqbalVB

    What do you mean?:confused: i don't understand it, please explain it more spesific.

    Visual Basic help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups