I need to get strresult to give me a clean string with no punctuation from strinput. I wanted to store that in strresult. My main goal was to write a loop to check the textbox input - strinput for letters a-z and store them in strresult and compare the reverse of that to strinput. I can do codes like mom, and things like that and it reads them, but when i add characters like mom! and red rum, sir, is murder...I am not stripping the punctuation off correctly.
The title says it all. How do I strip all punctuation from a string in vb.net? I really do not want to do stringname.Replace("$", "") for every single bit of punctuation, though it would work. How do i do this quickly and efficiently? Other than coding something that codes
I wrote a palindrome earlier for a project which I figured out but I talked to a friend in another class and he was having issues with how to take out the punctuation. I dont think it was required on mine but I am just currious how that could be done using commands such as str.lenght, or str.trim those basic commands. Here is my last post that is related
I have a gridview which in one column is displaying MAC addresses. Instead of displaying them in one row, its putting them in a column as wide as the "MAC" header column. If I remove the "-"'s, then it extends the column width and displays it as one row. Is there any way to have this happen with the "-"'s included?[code]...
How do I determain the servername that I should point to?
Here is my
Public Class frmViewReport Private Sub frmViewReport_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ViewReport("C:a2.rtp", , "@parameter1=test�mter2=10")
[code]....
Now... It seems to be unhappy with the following statement and I think it might be because I provided the wrong servername?
I am writing a service (service.exe) which I will be installing multiple times on a server with different display names (service1, service2,... servicen).Based on the display name the service will perform slightly different operations (e.g. monitor a different COM port).How can I programmatically determine the display name to find out which instance is executing?
Im just trying to determine if a website exists when i navigate my webbrowser. via messagebox.Ive tried this so far but it wont work:
Private Sub WebBrowser1_DocumentCompleted(ByVal sender As System.Object, ByVal e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WebBrowser1.DocumentCompleted If WebBrowser1.DocumentText.Contains("Action canceled") Then
Is this possible ? Im creating a desktop wallpaper changer using a timer to set a delay between images. the images im my directory folder is numbered from 1-15. If you look at the pic below theres an option to select how many images the user wants to display on the slideshow, if a user selects up to 15 thats fine. But what can i do if the user enters a number that exceeds the number of images in the directory.
I am trying to determine how my application is running. There are four (I thinkpossibilities:F5 in the IDECTRL F5 in the IDEPublish and Installed in Debug ConfigurationPublish and Installed in Release Configuration
How do I work out if 2 paths penetrate each other. I say penetrate as I do not just want to work out if they intersect or not ... as intersecting will return false if one path is completely within the other.
I am trying to create a function that will determine if a worksheet within the active workbook exits. I have searched many web sites without any luck. Here is the coding I have currently:
HTML Function SheetExists(ByVal sheetname As String) As Boolean Dim oWorkbook As Excel.Workbooks
[Code]....
It errors out at Dim oWorksheet As Excel.Worksheet = oWorkbook.Sheets(sheetname).
The error message I am getting is "Object variable or With block variable not set."
I would like to determine what apps are running on the computer. Not sure where to start.
While we are at it, is there any event that triggers that indicates that a new application has been started? Basically I am trying to log what applications are running on the application while my VB application is running.
I have a multi-processing application that kicks off up to 4 threads at a time to process data into a SQL-Server database. It seems to work okay, except at times the processors are pegged at 100% and all threads slow down a bit.
So, what I want to do is conditionally fire a thread based upon the processor load... if they're already running at 100%, it makes no sense to kick off another thread.
Is there a way to determine what the processor load is? Task manager shows processor load, so there probably is... but how do I do it?
I know this is just a simple question but I could hardly find the value for the buttons in msgbox for code execution.I tried to use codes I did in vb6 and was able to execute the codes properly but when I started vb2008 I encountered logical error for these codes.Let me take you alook for the codes:[code]When you click the yesbutton it executes the Statement1 but if you click the nobutton it should only execute Statement2.
1.Why is it when you click the nobutton it would still execute the Statement1 instead of Statement2?
2.What would be the right If..Then...Else statement should be used to execute it properly?
I have Visual Studio 2008/VB application that opens Excel workbooks, reads all the sheets, and writes some data to a SQL database. I need an easy way to determine if a sheet has any data on it. By default most books has three sheets (Sheet1, Sheet2, Sheet3) and usually, but not always, my books have data only on sheet1. But i need to look at alal sheets to check for the existence of data. I know I can do a nested for loop from 1 to columns.count and rows.count, but that would take a good bit of time since those numbers usually are something like 256 and 65K.
Is ther some easy way to determine if there is any data on the sheet? If there is, is there an easy way to find the "first" cell with data in it?
determine if a tabpage of a tabcontrol is being hovered over.I wanna set a property to true if it is hovered over and if it is I will then highlight it.this is what I have
vb.net Private _MouseHover As Boolean Public Property IsMouseHovered() As Boolean Get
[code]....
this clearly will put it over any tab page I need to make the property specific for each tab page.
I have written a program and deployed using clickonce to all desktop users. Additionally, the program is also installed (non clickonce) on a terminal server. (For security reasons, these users cannot install on their desktops). I need to add some code to the current program but only need this code to happen if it's being run as a Non ClickOnce Application. Does anyone know how to determine if the running version is a clickonce or not? Is there something in System.Deployment.Application that identifies?
I'm a student and I have a small project to create for my VB class. For the personal touch, I tried using a ListView to manage a SQL database (on a remote web server).What I need to do right now is determine how many items are selected (if more than one, enable delete and edit buttons, if more than one, disable edit button). I searched a lot for that, but didn't find anything working with me.Do you know a simple way I could get the number of items that are selected in my ListView?
Is it possible to have a sub that is triggered when any control of a specified type is clicked (or some other interaction), and then within the code of that sub, determine the sender and depending on the sender perform an action?For example, you create buttons dynamically, and assign them a name based on a counter that tells the number of buttons on the form. Now you click on a button, but there was no code written for 'button123.mouseclick' specifically. Instead, you get the name of the sender (button123) and you do something specific to that button.[code]
I am working on a way to determine if the lines of a RichTextBox have changed.I currently use this
Dim newhash As Integer = Me.Text.GetHashCode If newhash <> Me._prevhash Then Me._prevhash = newhash Me._lines = MyBase.Lines
[code]....
But this method has a bad issue: The text property takes a while to "load up" plus getting its hash code adds to it. This code runs every time the Lines are needed (it is a property). So this
For i As Integer = 0 To Lines.Count - 1 Dim line As String = Lines(i) Next
Takes ages to complete, because for every line it checks if the lines have changed.I am trying to evade using MyBase.Lines too much, since that REALLY takes ages to load.
- I can not use the modified property since it is unreliable (set to true if only a text color changes)
- Can't use the RTF since it changes without the text changing (coloring) and the hash code is slow as well.
- Can't use the TextChanged event, since it is sent after the SelectionChanged event (for some reason)
I am back with new problem using TabControl in VBNET2008 Window Application I am trying to figure out how to determine logically either TabPage1 or TabPage2 header button is clicked on.
The TabControl has 2 Pages: TabPage1 Text = Display Orders TabPage2 Text = Edit Transaction.
I need to know which one is clicked on in order to write the routines.
I have a program that copies files to several servers in succession. If one of those servers is unavailable for any reason, my program hangs for about a minute before it continues on to the next server. Is there a quicker way to determine if the path is available or not?
I am modifying some code I found here to test to see if a user has scrolled to the end of the control. In this case the control is a Crystal Viewer but I posted here because I think the issue is based on the vertical scrollbar not the Crystal Viewer itself.
The code flags an error at
Me.CRViewer.Controls.OfType Indicating 'OfType' is not a member of 'System.Windows.Forms.Control.ControlCollection'.
I understand the concept that I can't reference something that it is not but I don't know how to fix it. The original code was for a DataGridView.
The ultimate goal (not finished) is to find out when the user has used the mouse or possibly the scroll bar itself and if it hits the bottom of the page of the viewer, then trigger a new page so it looks like they can just keep using the mouse to scroll.
Public Sub New() Me.InitializeComponent() Dim vscroll As VScrollBar = Me.CRViewer.Controls.OfType(Of VScrollBar)
way to reset a timer if there is form activity so it will not expire until the mouse has been at rest for 2 minutes.
This timer runs for 120000 milliseconds usually, and sometimes it lapses (and logs you out) when you are in the middle of editing. Sometimes 2 minutes is not enough time to do all the edits. So I wish to reset the remaining interval as long as there is mouse activity. But I am not sure the best method to do this?
I have found the mousemove event but to me this seems like it's going to fire way too often and tax the resources if I preform operations here, maybe not? Is there a better way to get this functionality?
I want this functionality so that if someone starts editing on the UI and walks off/gets distracted it will lock the grids back so that some other user can't come dork things up.
I am using a webbrowser control, which is used for both internet and folder exploring. How can I determine when viewing files on the local directory, which file is selected?
I ran across something in my searches saying there was a property under the webbrowser.document called SelectedItem. But this must not be in 2008.