Click here to Skip to main content
15,919,749 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to insert lines of text into an existing text file? Pin
MJay3-Mar-04 16:31
MJay3-Mar-04 16:31 
AnswerRe: How to insert lines of text into an existing text file? Pin
Nadroj3-Mar-04 18:47
Nadroj3-Mar-04 18:47 
GeneralRe: How to insert lines of text into an existing text file? Pin
MJay8-Mar-04 2:10
MJay8-Mar-04 2:10 
GeneralRe: How to insert lines of text into an existing text file? Pin
Dave Kreskowiak8-Mar-04 2:46
mveDave Kreskowiak8-Mar-04 2:46 
AnswerRe: How to insert lines of text into an existing text file? Pin
Dave Kreskowiak8-Mar-04 2:42
mveDave Kreskowiak8-Mar-04 2:42 
QuestionFormatting a diskette? Pin
KreativeKai3-Mar-04 8:34
professionalKreativeKai3-Mar-04 8:34 
AnswerRe: Formatting a diskette? Pin
Mike Ellison3-Mar-04 10:22
Mike Ellison3-Mar-04 10:22 
AnswerRe: Formatting a diskette? Pin
Dave Kreskowiak3-Mar-04 10:37
mveDave Kreskowiak3-Mar-04 10:37 
Try this:
Const SHFMT_ID_DEFAULT = -1
Const SHFMT_OPT_FULL = 1
Const SHFMT_OPT_SYSONLY = 2
Const SHFMT_ERROR = -1          ' Error on last format, drive may be formatable
Const SHFMT_CANCEL = -2         ' Last format was canceled
Const SHFMT_NOFORMAT = -3       ' Drive is not formatable

' SHFormatDrive takes 4 parameters:
'   hWnd        The handle to the window that will be the dialogs parent window.
'   Drive       The drive number to format, 0 is A:, 1 is B:, 2 is C:, ...
'   fmtID       Must always be SHFMT_ID_DEFAULT, or the value ????.
'   options     Opitons.
Private Declare Function SHFormatDrive Lib "shell32" ( _
    ByVal hWnd As IntPtr, _
    ByVal Drive As Integer, _
    ByVal fmtID As Integer, _
    ByVal options As Integer) _
    As Integer

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    Dim iDrive As Integer
    Dim rc As Integer

    iDrive = 0
    rc = SHFormatDrive(Me.Handle, iDrive, 0, 0)
    Select Case rc
        Case SHFMT_ERROR
            MsgBox("Format failed, user pressed CLOSE")
        Case SHFMT_CANCEL
            MsgBox("Format cancelled - user hit CLOSE")
        Case SHFMT_NOFORMAT
            MsgBox("Unable to format this disk drive")
        Case Else
            MsgBox("Disk was formatted successfully and returned: " & rc)
    End Select
End Sub

This will show the format dialog that you see when you do a format from the Explorer Shell. The format won't start until the user presses OK.


RageInTheMachine9532
GeneralRe: Formatting a diskette? Pin
KreativeKai15-Mar-04 5:50
professionalKreativeKai15-Mar-04 5:50 
GeneralRe: Formatting a diskette? Pin
Dave Kreskowiak15-Mar-04 6:50
mveDave Kreskowiak15-Mar-04 6:50 
QuestionHow can i login to yahoo from vb.net??? Pin
drcyrus3d3-Mar-04 6:24
drcyrus3d3-Mar-04 6:24 
Questionwat is subclassing and how is it used? Pin
gpa20003-Mar-04 5:51
gpa20003-Mar-04 5:51 
AnswerRe: wat is subclassing and how is it used? Pin
Mike Ellison3-Mar-04 7:50
Mike Ellison3-Mar-04 7:50 
Questionwhat is hWnd and how is it used Pin
gpa20003-Mar-04 5:49
gpa20003-Mar-04 5:49 
AnswerRe: what is hWnd and how is it used Pin
Dave Kreskowiak3-Mar-04 10:10
mveDave Kreskowiak3-Mar-04 10:10 
GeneralOpening a website when button pressed Pin
GaryKoh3-Mar-04 3:26
GaryKoh3-Mar-04 3:26 
GeneralRe: Opening a website when button pressed Pin
gpa20003-Mar-04 5:45
gpa20003-Mar-04 5:45 
GeneralRe: Opening a website when button pressed Pin
GaryKoh6-Mar-04 16:18
GaryKoh6-Mar-04 16:18 
GeneralPrint at the center Pin
terence20042-Mar-04 21:46
terence20042-Mar-04 21:46 
GeneralRe: Print at the center Pin
Dave Kreskowiak3-Mar-04 2:01
mveDave Kreskowiak3-Mar-04 2:01 
GeneralRe: Print at the center Pin
terence20043-Mar-04 13:53
terence20043-Mar-04 13:53 
GeneralRe: Print at the center Pin
Dave Kreskowiak3-Mar-04 18:14
mveDave Kreskowiak3-Mar-04 18:14 
GeneralSet assignment not supported Pin
Reed Eichner2-Mar-04 19:28
Reed Eichner2-Mar-04 19:28 
GeneralRe: Set assignment not supported Pin
Dave Kreskowiak3-Mar-04 1:32
mveDave Kreskowiak3-Mar-04 1:32 
GeneralCreating Access Database using Code Pin
vister722-Mar-04 10:18
vister722-Mar-04 10:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.