
SonicBoomAu
Avatar/Signature-
Posts
179 -
Joined
-
Last visited
About SonicBoomAu
- Birthday 11/17/1977
Personal Information
-
Visual Studio .NET Version
Visual Studio .Net 2003, VB6
-
.NET Preferred Language
VB.Net
SonicBoomAu's Achievements
Newbie (1/14)
0
Reputation
-
I believe that the server disables the shutdown/reset option from the login box. But, that being said, when you have logged into the server you then have the ability (with the appropriate permissions) to shutdown or restart the server. HTH.
-
I think the txtRange is the name of the text box.
-
I might be totally off the mark, but.... Couldn't you possibly do a string search from the left and capture everything infront of the "space" and do the same from the right. Dim sr As String = "This is the big brown dog" Dim fposition As Integer Dim lposition As Integer Dim fWord As String ' The first word Dim lWord As String ' The last word ' Find the position of the first space fposition = InStr(sr, " ") ' Minus 1 from the number so that you just capture the first word not the space fposition = fposition - 1 ' Capture the first word fWord = Microsoft.VisualBasic.Left(sr, fposition) ' Find the position of the last space lposition = InStrRev(sr, " ") ' To find the number of characters from the right minus the value of lposition from total length Dim FromEnd As Integer FromEnd = sr.Length - lposition ' Capture the last word lWord = Microsoft.VisualBasic.Right(sr, FromEnd) ' Display the First word .... Last word MessageBox.Show(fWord & " ... " & lWord) To find this information, I just did a google search on "Search String Character Visual Studio". Hope this helps
-
Having a quick search on the web i found the following sites which should be able to help you out. http://msdn2.microsoft.com/en-us/library/aa188489(office.10).aspx#vsofficedev_topic2 http://support.microsoft.com/kb/q184974/ Hope this helps
-
Try the following: http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx#q792q Or http://www.xtremedotnettalk.com/showthread.php?t=91566
-
Have a look at the following site, it will provide you hopefully with the information you require. http://www.syncfusion.com/FAQ/WindowsForms/Default.aspx#44 Hope this Helps
-
Have a look at this site. http://www.syncfusion.com/FAQ/WindowsForms/FAQ_c44c.aspx
-
Problem with Excel and Option Strict On
SonicBoomAu replied to SonicBoomAu's topic in Interoperation / Office Integration
I managed to fix the first problem, i think. objSheet = Ctype(objSheet(1), Excel.Worksheet) -
Hi All, I have started to update one of my programs and have decided i should follow the general rule and turn Option Strict On and Option Explicit On and have come across a problem, which I am hope someone will know the answer for. A sample of my code is as follows: Option Strict On Option Explicit On Imports Microsoft Imports Microsoft.Office Imports Microsoft.Office.Interop ' Start Adding Details to a New Excel Workbook Dim objApp As Excel.Application Dim objBook As Excel._Workbook Dim objBooks As Excel.Workbooks Dim objSheets As Excel.Sheets Dim objSheet As Excel._Worksheet Dim range As Excel.Range Dim PR As DialogResult ' Create a new instance of Excel and start a new workbook. objApp = New Excel.Application objBooks = objApp.Workbooks objBook = objBooks.Add objSheets = objBook.Worksheets objSheet = objSheets(1) objApp.DisplayAlerts = False ' Display only the one sheet not the default three Dim intSheetCount As Integer Dim blnSheetCount As Boolean = False Do Until blnSheetCount = True intSheetCount = objSheets.Count If intSheetCount = 1 Then blnSheetCount = True Else [color="Red"]objBook.Sheets(2).delete()[/color] End If Loop ' Set the page display for the First Page objSheet.Name = "DIntTC Multi Issue" objSheet.PageSetup.Orientation = Excel.XlPageOrientation.xlPortrait objSheet.Range("B2:E2").Merge() objSheet.Range("B2:E2").BorderAround() objSheet.Range("B3:E3").Merge() objSheet.Range("B3:E3").BorderAround() objSheet.Range("B5:E5").Merge() objSheet.Range("B5:E5").BorderAround() [color="red"]objApp.Columns("A").ColumnWidth = "5" objApp.Columns("B").ColumnWidth = "17.57" objApp.Columns("C").ColumnWidth = "24.43" objApp.Columns("D").ColumnWidth = "17.57" objApp.Columns("E").ColumnWidth = "8.43" objApp.Columns("F").ColumnWidth = "5"[/color] ..... ' Exit out of Excel objSheet = Nothing objBook = Nothing objApp.Quit() objApp = Nothing My first problem is on the line "objSheet = objSheets(1)" the error description is: Option Strict On disallows implicit conversions from 'System.Object' to 'Microsoft.Office.Interop.Excel._Worksheet'. The next problem all come up with the description of: Option Strict On Disallows late bindings. I have highlighted the Lines on code that this is effecting. But this problem may be solved with the first problem. I have tried to change the objApp.Coluns to objSheet.Columns and had the same problem. Thank you in advance for your help.
-
With the help of some other websites. I have managed to capture and release the TAB key press event. The code used is below to help the next person. Firstly create a Class and paste in the following code: Option Strict On Option Explicit On Public Class TextBoxEx Inherits System.Windows.Forms.TextBox Private _TabRaisesEvents As Boolean = False Protected Overrides Function IsInputKey(ByVal keyData As System.Windows.Forms.Keys) As Boolean If keyData = Keys.Tab Then Return _TabRaisesEvents Else Return MyBase.IsInputKey(keyData) End If End Function Public Property TabRaisesEvents() As Boolean Get Return _TabRaisesEvents End Get Set(ByVal value As Boolean) _TabRaisesEvents = value End Set End Property End Class "then compile your project, and replace your existing textbox control, with this one from your toolbox. This will allow tab to fire the keypress and keydown events." Code and quote from here I just changed my textboxes in the Windows Form Designer generated code area from 'Friend WithEvents txtSigneeName as System.Windows.Forms.TextBox to Friend WithEvents txtSigneeName as TextBoxEx' and 'Me.txtCourseDates = New System.Windows.Forms.TextBox to Me.txtCourseDates = New TextBoxEx' The keypress press Event is as follows: Private Sub txtSigneeName_KeyPress (ByVal sender AS Object, ByVal e AS System.Windows.Forms.KeyPressEventArgs) Handles txtSigneeName.KeyPress ' Set .TabRaisedEvent to True Me.txtSigneeName.TabRaisesEvents = True ' Capture if the Tab key was used to navigate to next control If e.char = Chr(Keys.Tab) Then blnTabPress = True ' Set the TabRaisesEvents to False so that Tab can now act as normal Me.txtSigneeName.TabRaisesEvents = False ' Generate Tab key press so that focus goes to the next control SendKeys.Send ("{tab}") End If End Sub Hope this helps the next person.
-
I have tried to capture the keypress event, but it somehow misses the tab keypress. Code is: Private Sub txtCourseDates_KeyPress(byVal sender as Object, ByVal e as System.Windows.Forms.KeyPressEventArgs) Handles txtCourseDates.KeyPress If e.KeyChar = Chr(keys.Tab) then blnTabPress = True End If End Sub Before you ask blnTabPress is declared earlier. I then tried to capture the Tab using the Lost Focus event. But this threw a NullException Error. Code is : Private Sub txtCourseDates_LostFocus(byVal sender as Object, ByVal e as System.EventArgs) Handles txtCourseDates.LostFocus Dim ek as System.Windows.Forms.KeyPressEventArgs If ek.KeyChar = Chr(keys.Tab) then blnTabPress = True End If End Sub Does anyone have any ideas?
-
Or would i be better, capturing the keypress before it leaves the last control?
-
Could you use: If File.Exists (My.Application.DirectoryPath, "*.txt") then File.Delete End If or Do While File.Exists (My.Application.DirectoryPath, "*.txt") = True File.Delete Loop
-
Hi All, I hoping this can be done, and i sure someone here can tell me, so here goes. I am using a Windows form and would like a combo box to drop down automatically but only if it has been Tab'd to. At the moment my code is: Private Sub cboWings_GotFocus(ByVal sender as Object, Byval e as System.eventArgs) Handles cboWings.GotFocus ' Automatically drop down the list for selection me.cbowings.droppedDown = True End Sub What i would like to do is throw in a If statement, so the me.cboWings.droppedDown = True on fires when Tab was used to get to that control. Private Sub cboWings_GotFocus(ByVal sender as Object, Byval e as System.EventArgs) Handles cboWings.GotFocus ' Automatically drop down the list for selection if key press was tab If keypress = TAB then me.cbowings.droppedDown = True End If End Sub Is something like this possible? At the moment with the current code someone has to click on the dropdown arrow to display the items in the control. The first click displays the items but automatically hides them again. Thank you all in advance for your help.
-
Copy Directories accross VOlumes
SonicBoomAu replied to kcwallace's topic in Directory / File IO / Registry
This forum link might help you with the code