Jump to content
Xtreme .Net Talk

Robby

Moderators
  • Posts

    3848
  • Joined

  • Last visited

Everything posted by Robby

  1. You can create a Public Property to Set/Get the username. Place this Property either in a new class or in your main form.
  2. A couple of samples which should do what you want... ' Declare Excel object variables and create types Dim xlApp As Excel.Application Dim xlBook As Excel.Workbook Dim xlSheet As Excel.Worksheet xlApp = CType(CreateObject("Excel.Application"), Excel.Application) xlBook = CType(xlApp.Workbooks.Add, Excel.Workbook) xlSheet = CType(xlBook.Worksheets(1), Excel.Worksheet) ' Insert data xlSheet.Cells(1, 2) = 5000 xlSheet.Cells(2, 2) = 75 xlSheet.Cells(3, 1) = "Total" ' Insert a Sum formula in cell B3 xlSheet.Range("B3").Formula = "=Sum(R1C2:R2C2)" ' Format cell B3 with bold xlSheet.Range("B3").Font.Bold = True ' Display the sheet xlSheet.Application.Visible = True ' Save the sheet to c:\vbnetsbs\chap13 folder xlSheet.SaveAs("C:\myexcelsheet.xls") ' Leave Excel running and sheet open Dim EXL As New Excel.Application() Dim WSheet As New Excel.Worksheet() WSheet = EXL.Workbooks.Add.Worksheets.Add With WSheet .Cells(2, 1).Value = "1st Quarter" .Cells(2, 2).Value = "2nd Quarter" .Cells(2, 3).Value = "3rd Quarter" .Cells(2, 4).Value = "4th Quarter" .Cells(2, 5).Value = "Year Total " .Cells(3, 1).Value = 123.45 .Cells(3, 2).Value = 435.56 .Cells(3, 3).Value = 376.25 .Cells(3, 4).Value = 425.75 .Range("A2:E2").Select() With EXL.Selection.Font .Name = "Verdana" .FontStyle = "Bold" .Size = 12 End With End With WSheet.Range("A2:E2").Select() EXL.Selection.Columns.AutoFit() WSheet.Range("A2:E2").Select() With EXL.Selection .HorizontalAlignment = Excel.XlHAlign.xlHAlignCenter End With ' Format numbers WSheet.Range("A3:E3").Select() With EXL.Selection.Font .Name = "Verdana" .FontStyle = "Regular" .Size = 11 End With WSheet.Cells(3, 5).Value = "=Sum(A3:D3)" Dim R As Excel.Range R = WSheet.UsedRange Dim row, col As Integer For row = 1 To R.Rows.Count TextBox1.AppendText("ROW " & row & vbCrLf) For col = 1 To R.Columns.Count TextBox1.AppendText("[" & row & ", " & col & _ " : " & vbTab & R.Cells(row, col).value & "]" & vbCrLf) Next TextBox1.AppendText(vbCrLf) Next Try WSheet.SaveAs("C:\TEST.XLS") Catch End Try Me.Text = "File Created" EXL.Workbooks.Close() EXL.Quit()
  3. myname26: did you not say that this was in Access? If you're using SQL Server then you need to use DatePart().
  4. Windows Forms Sample: Update Datagrid using SQL Server or MS Access The sample allows you to make changes to the Datagrid and save them using Update, Delete or Insert. Most controls are placed at run-time. datagrid_update_sql_ole.zip
  5. You should be using IO.StreamWriter in .NET [edit]D'oh, Mutant's up early. :)[/edit]
  6. As I stated in my previous post, do your formatting in your SQL... 'FieldDate being your column name in the table "SELECT FieldOne, Fieldtwo, Format(DateValue([FieldDate]),"dd/mm/yyyy") AS myDate FROM myTable" Hog - The problem with setting as ShortDate at the table level is that the format would change depending on the OS culture settings. Some countries are 'dd/mm/yy' others 'mm/dd/yy'
  7. iebidan: Can you provide a link to Microsoft's site where one can download it?
  8. I think your formatting should be done in the SQL statement you used to pull the original command.
  9. Steve, no one is upset, and don't worry about being corrected, I've been wrong on many occasion.
  10. Go to > User Control Panel > Edit Options > then select Yes in Use 'Email Notification' by default? This will subscribe you to a thread (you reply to) automaticaly.
  11. In menu item View > Editor > File System > expand the tree... there you can create folders, add files and shortcuts
  12. Also, if you want to track the Exit of the process.... Private WithEvents myProcess As New Process() Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load myProcess = Process.Start("C:\j2sdk1.4.0_01\bin\java.exe waveplay") myProcess.EnableRaisingEvents = True End Sub Private Sub myProcess_Exited(ByVal sender As Object, ByVal e As System.EventArgs) Handles myProcess.Exited MessageBox.Show("Thank you") End Sub
  13. try this... Dim myProcess As New Process() myProcess = Process.Start("C:\j2sdk1.4.0_01\bin\java.exe waveplay")
  14. You may want to do this for your loop... For i = 0 To newForm1.ListBox1.Items.count -1
  15. I may be wrong (I haven't attempted this with .NET) but when you use a system font and the user has selected to change the style, (Theme/Scheme) his prefered font should take over. I don't know how Bold would affect this. OR, I may be wrong about the entire thing. You can try it though.
  16. It should be the one that is set as default.
  17. When using numeric values don't use the single quotes... Dim Str1 As String = "Select * from EstHeader Where HeaderID = " & HeaderID
  18. Is the .OCX registered on that machine?
  19. What does your code look like when the link is clicked? (surrounding the link)
  20. One thing I don't understand is why you declared S as Single, then you Convert it to String. Did you mean to declare S as String ? Is so, then this will work... Dim l As Long Dim S As String l = Long.MaxValue S = l.ToString S = (Convert.ToInt64(S) - 1000000000000).ToString l = Convert.ToInt64(S) MessageBox.Show(Long.MaxValue & ControlChars.NewLine & l.ToString)
  21. Ok, with your Setup Solution click menu item View > Editor > User Interface, you should have a tree (parents) Install and Administrative, all sub nodes below them have a property 'BannerBitmap'. Do you have all of the above?
  22. You can use Left,Top,Height,Width of the previous control to determine where it is located prior to adding a new control.
  23. here's a direct link ... http://www.3leaf.com/default/articles/ea/SBS.aspx
  24. Dan; I mean the wizard that is created for you to use for the msi (package). I don't know if the Standard can even create a deployment package.
  25. Steve, you may want to follow the link provided by Derek ...http://www.xtremedotnettalk.com/showthread.php?s=&threadid=71525
×
×
  • Create New...