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
J

JamesS C1

@JamesS C1
About
Posts
9
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • how to use scroll bar in pictur box
    J JamesS C1

    Hello Piyush, I hope the following code helps: Private bWindowIsResizable As Boolean Private Const WM_NCLBUTTONDOWN = &HA1 Private Const HTBOTTOMRIGHT = 17 Private Declare Function SendMessage Lib "user32" _ Alias "SendMessageA" _ (ByVal hwnd As Long, _ ByVal wMsg As Long, _ ByVal wParam As Long, _ lParam As Any) As Long Private Declare Function ReleaseCapture Lib "user32" () As Long Private Sub Form_Load() HScroll1.Height = 255 VScroll1.Width = 255 'set flag indicating a resizable window bWindowIsResizable = (Me.BorderStyle = vbSizable) Or _ (Me.BorderStyle = vbSizableToolWindow) 'set up the picture box used to fill 'the corner between the H and V scroll 'bars, and if the window is sizable 'print a 'gripper' image to the control With Picture3 .AutoRedraw = True .AutoSize = True .ForeColor = &H80000015 .BackColor = Me.BackColor .BorderStyle = 0 .ZOrder 0 'if sizable windows print the gripper image If bWindowIsResizable Then .Font.Size = 11 .Font.Name = "Marlett" .Font.Bold = False Picture3.CurrentX = 10 Picture3.CurrentY = 10 Picture3.Print "o" End If End With With Picture1 .BorderStyle = 0 .Move 0, 0 .Cls End With With Picture2 'inner (cyan) picture box 'as we're loading an image, expand pix2 'to the size of the loaded graphic .AutoSize = True .BorderStyle = 0 .Move 0, 0 .Cls 'obviously, change this to a valid image on your system .Picture = LoadPicture("c:\windows\xp5layout.jpg") End With With HScroll1 .Max = (Picture2.ScaleWidth - Picture1.ScaleWidth) .LargeChange = .Max \ 10 .SmallChange = .Max \ 25 .Enabled = (Picture1.ScaleWidth <= Picture2.ScaleWidth) .ZOrder 0 End With With VScroll1 .Max = (Picture2.ScaleHeight - Picture1.ScaleHeight) .LargeChange = .Max \ 10 .SmallChange = .Max \ 25 .Enabled = (Picture1.ScaleHeight <= Picture2.ScaleHeight) .ZOrder 0 End With Picture3.ZOrder 0 End Sub Private Sub Form_Resize() 'Picture1 is the *outer* pix box (the red viewport) 'Picture2 is the inner pix box (the cyan container to scroll within the viewport) 'don't attempt resizing if minimized! If Me.WindowState <>

    Visual Basic tutorial

  • retrieve the length of an mp3 file?
    J JamesS C1

    Hello Mr Ozio, I hope the code below helps to retrieve information about MP3 file: Option Explicit Public Type MP3Info Tag As String * 3 Songname As String * 30 Artist As String * 30 Album As String * 30 Year As String * 4 Comment As String * 30 Genre As String * 1 End Type Function MP3GetInfo(strFileName As String) As MP3Info Dim sTemp As String, iFreeFile As Integer On Error GoTo ErrFailed iFreeFile = FreeFile Open strFileName For Binary As iFreeFile With MP3GetInfo Get #1, FileLen(strFileName) - 127, .Tag If Not .Tag = "TAG" Then Debug.Print "No tag for " & strFileName Else Get #1, , .Songname Get #1, , .Artist Get #1, , .Album Get #1, , .Year Get #1, , .Comment Get #1, , .Genre End If End With Close iFreeFile Exit Function ErrFailed: Debug.Print "Error in MP3GetInfo: " & Err.Description Close iFreeFile End Function Thanks, James Smith

    James Smith www.componentone.com

    Visual Basic help question

  • Error code 269
    J JamesS C1

    Hello, Error 269 means that ReferenceBind is invalid. Reference name is missing. I hope this helps. Have a nice day. Regards, James Smith

    James Smith www.componentone.com

    COM help question

  • Record Audio From Microphone
    J JamesS C1

    Hello, You may use the following VB Script to record audio: Dim rec Set rec = CreateObject("AudioCtl.AudioRecord.1") 'Select sound device 0 rec.DeviceIndex = 0 'Set output file rec.SetOutputFileName "1.mp3" 'Start record with given parameters, record mp3 audio rec.StartRecord 2, 11025 'Record for 10 secs WScript.Sleep 10000 'Stop Record rec.StopRecord Thanks, James

    James Smith www.componentone.com

    Visual Basic question help

  • Dynamic loading data in crystal report
    J JamesS C1

    Hello, To include the report on the Web page, we need to drag and drop the Crystal Report Viewer control from the Toolbox. Because the Crystal Report Viewer control doesn't have a ReportSource property available at design time, you have to set that property inside your code. Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer #Region " Windows Form Designer generated code " Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load CrystalReportViewer1.ReportSource = Server.MapPath("crystalreport1.rpt") End Sub End Class. or you can create instance of the report class which was created by Visual Studio.NET when you designed your report. The name of that file is same as report that you create CrystalReport1.vb. To see this file expand CrystalReport1.rpt (click on + sign in front of the CrystalReport1.rpt). Imports CrystalDecisions.CrystalReports.Engine Imports CrystalDecisions.Shared Public Class WebForm1 Inherits System.Web.UI.Page Protected WithEvents CrystalReportViewer1 As CrystalDecisions.Web.CrystalReportViewer #Region " Windows Form Designer generated code " Dim crpt As CrystalReport1 Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load crpt = New CrystalReport1() CrystalReportViewer1.ReportSource = crpt End Sub End Class. If you set WebForm1.aspx to be the Start Up page for the project, and start the project, you will get the report page if you have blank password in database for "sa". If "sa" or any other user name that you want to use to access database has password, when you run the report, you will see the "LogonFailed" error. If we were developing windows application, Crystal Reports will ask us for password information. This error occured, because when you design and save report, all of the connection information is saved within the report except password. If the password is blank, there will be no problem to create or generate the report. To prevent this, you will need to provide login information in your code before you set ReportSource property. To do so, you will add some code in Page_Load event. Now, your code should look like: Imports CrystalDecisions.CrystalReports.Engine

    Visual Basic tutorial question

  • Print a Formm
    J JamesS C1

    Hello Trupti, Printing in Windows Forms consists primarily of using the PrintDocument Component (Windows Forms) component to enable the user to print, and the PrintPreviewDialog Control (Windows Forms) control, PrintDialog Component (Windows Forms) and PageSetupDialog Component (Windows Forms) components to provide a familiar graphical interface to users accustomed to the Windows operating system. Typically, you create a new instance of the PrintDocument component, set the properties that describe what to print using the PrinterSettings and PageSettings classes, and call the Print method to actually print the document. During the course of printing from a Windows-based application, the PrintDocument component will show an abort print dialog box to alert users to the fact that printing is occurring and to allow the print job to be canceled. The foundation of printing in Windows Forms is the PrintDocument component—more specifically, the PrintPage event. By writing code to handle the PrintPage event, you can specify what to print and how to print it. To create a print job: 1. Add a PrintDocument component to your form. 2. Write code to handle the PrintPage event. You will have to code your own printing logic. Additionally, you will have to specify the material to be printed. In the following code example, a sample graphic in the shape of a red rectangle is created in the PrintPage event handler to act as material to be printed. Visual Basic Copy Code Private Sub PrintDocument1_PrintPage(ByVal sender As Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage e.Graphics.FillRectangle(Brushes.Red, New Rectangle(500, 500, 500, 500)) End Sub C# Copy Code private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.Graphics.FillRectangle(Brushes.Red, new Rectangle(500, 500, 500, 500)); } J# Copy Code private void printDocument1_PrintPage(Object sender, System.Drawing.Printing.PrintPageEventArgs e) { e.get_Graphics().FillRectangle(Brushes.get_Red(), new Rectangle(500, 500, 500, 500)); } C++ Copy Code private: void printDocument1_PrintPage(System::Object ^ sender, System::Drawing::Printing::PrintPageEventArgs ^ e) { e->Graphics->FillRectangle(Brushes::Red, Rectangle(500, 500, 500, 500)); } (Visual C#, Visual J# and Visual C++) Place the following code in the form's constructor to register the event handler. C

    Visual Basic csharp help question

  • deploying application.
    J JamesS C1

    Hello, I would suggest you to add reference for the System.management class in your project and I hope that following code will return the free physical memory Dim freeMemory As New ManagementClass("Win32_OperatingSystem") Dim memory As ManagementObjectCollection = freeMemory.GetInstances() Dim memEnum As ManagementObjectCollection.ManagementObjectEnumerator = memory.GetEnumerator() memEnum.MoveNext() MessageBox.Show("Physical memory total space is: " & Format(Integer.Parse(memEnum.Current.Properties("FreePhysicalMemory").Value) / 1024, "#,### KB")) I hope this helps. James Smith

    James Smith www.componentone.com

    Visual Basic csharp database sysadmin performance

  • Crystal Report In VB
    J JamesS C1

    Hello, I hope you are doing great. I found one article, which may help you to export the crsytal reports to Excel using VB: http://aspalliance.com/478_Exporting_to_Excel_in_Crystal_Reports_NET__Perfect_Excel_Exports.all[^] I hope this helps. Have a nice day. Regards, James Smith

    James Smith www.componentone.com

    Visual Basic tutorial question

  • Speed up a VB.net project
    J JamesS C1

    Hello Pete, If your report contains sub-report, please try to uncheck the checkbox "Re-import When Opening" in the "Subreport" tab page of Format Editor of the subreport. You may also try to declare global object of report, when user first starts your application create a new thread and in this new thread fill data in your report but do not bind it to CrystalReport Viewer, when the user wants to view report on click of some button then bind this report to Viewer. I hope this helps. Regards, James

    James Smith www.componentone.com

    Visual Basic csharp database sysadmin performance
  • Login

  • Don't have an account? Register

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