Jump to content
Xtreme .Net Talk

usvpn

Avatar/Signature
  • Posts

    48
  • Joined

  • Last visited

Everything posted by usvpn

  1. Hi, When I am inside a thread, I cannot simply call Me.Close or I get cross threading error! So I need to use some code like this and then call SetClose() Private Delegate Sub SetCloseCallback() Private Sub SetClose() If Me.InvokeRequired Then Dim d As New SetCloseCallback(AddressOf SetClose) Me.Invoke(d, New Object() {Me}) Else Me.Close() End If End Sub But this don't work for some reason I don't know, anyone can see something wrong with my code? :confused: Thank you.
  2. usvpn

    Close Form

    Edit by mod: thread is cross posted at XVBT. Hi, How can I close the form by pressing the scape button? I know I can put a button on form and set the form CancelButton to this button, but is there another way without placing that button? Thanks
  3. Note from mod: Thread is cross-posted at XVBT. Hi everyone :) I have written a function which is a loop and is similar to old Val() function, I just wanna loop through all characters of an input string and return the numbers: Private Function GetStrVal(ByVal InputString As String) As Integer GetStrVal = Nothing For MyLoop As Integer = 1 To InputString.Length If InputString.Substring(MyLoop - 1, 1) = 0 Or _ InputString.Substring(MyLoop - 1, 1) = 1 Or _ InputString.Substring(MyLoop - 1, 1) = 2 Or _ InputString.Substring(MyLoop - 1, 1) = 3 Or _ InputString.Substring(MyLoop - 1, 1) = 4 Or _ InputString.Substring(MyLoop - 1, 1) = 5 Or _ InputString.Substring(MyLoop - 1, 1) = 6 Or _ InputString.Substring(MyLoop - 1, 1) = 7 Or _ InputString.Substring(MyLoop - 1, 1) = 8 Or _ InputString.Substring(MyLoop - 1, 1) = 9 Then GetStrVal = GetStrVal + InputString.Substring(MyLoop - 1, 1) End If Next End Function It won't work and I get errors also I do believe there's a better way to compare if input is between 0 and 9? :confused: Any idea?
  4. usvpn

    Read File

    Hi, I have a text file with exactly 2 lines! I can read the whole file with System.IO.File.ReadAllText, but this will return both lines! How should I get the 1st and 2nd line separately? Thank you :)
  5. Hi, Anyone knows what's the name of this pointer in DataGridView (attached picture)? And how can I move it programatically? I tried: DataGridView1.Rows.Item(2).Selected = True DataGridView1.FirstDisplayedScrollingRowIndex = 2 But didn't work, so how can I move this pointer to the other rows via code?
  6. When you add items to the DataGridView1 it will automatically select the 1st row, even if you use DataGridView1.ClearSelection afterwards, the 1st row is still selected! However, my problem is that if you use :: DataGridView1.ClearSelection() DataGridView1.Rows.Item(2).Selected = True DataGridView1.FirstDisplayedScrollingRowIndex = 2 Still the 1st row is selected! :confused: Anyone knows about it? WindowsApplication1.zip
  7. Hi, I want to scroll to the first selected row in my DataGridView. You know I programmatically select a number of rows, and then want to scroll to the 1st selected row. I heard about FirstDisplayedScrollingRowIndex property but can't figure it. Anyone knows how to find the 1st selected row? and then scroll to it? Thank you :p
  8. Hi, I have no idea why when I compile and run my application in x64 mode or anycpu my application crashes some time. some times it returns : Unhandled Exception Attempted to read or write protected memory. This is often an indication that other memory is corrupt. and some times just says x has stopped working w/o details, any one knows anything about it ? :(
  9. I heard that Arguments cannot have spaces and each switch should be sent separately, no I just wanna make sure :)
  10. Hi, I use this code in a loop to launch some files and wait for each one to close: Dim MyProcess As System.Diagnostics.Process MyProcess = New System.Diagnostics.Process() MyProcess.StartInfo.FileName = ProcessPath MyProcess.StartInfo.Arguments = "/quiet /norestart" MyProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal MyProcess.Start() MyProcess.WaitForExit() MyProcess.Close() However, I am not sure if I used MyProcess.StartInfo.Arguments in the correct format. To each file 2 arguments should be sent : /quiet and /norestart I just put both in double quotations is that the right way? Thanks :)
  11. of course x64 :confused:
  12. Hi everyone, I have a strange problem in my VB.NET project when I want to compile it as x64. If I set the target CPU to Any CPU, it will be fine and on x64 systems it will run as x64. But if I set the target CPU to only x64, my project will show up some error/warnings and won't compile at all, here are them: - Error 1 : An attempt was made to load an assembly with an incorrect format Warning 2 : Possible problem detected while building assembly 'x': Referenced assembly 'mscorlib.dll' targets a different processor Warning 3 : Possible problem detected while building assembly 'x': Referenced assembly 'System.Data.dll' targets a different processor Warning 4 : Possible problem detected while building assembly 'x': Referenced assembly 'System.EnterpriseServices.dll' targets a different processor - This is very strange, those are system assemblies and my project is .NET Framework 2.0. How they can run when my application is set to any CPU but not at x64 only?! If anyone had this problem or know a solution please help me :confused:
  13. Hi, I am looking for a .NET HTML editor commercial component to use in my VB.NET application which supports both x86 and x64 platforms. The more I google the less I found! If anyone knows about a good one please tell me :) Thanks :)
  14. So how do you recommend me to just check for root folder? Thank you
  15. Hi, I have a dynamic path and every time I want to check it and if it is the root of drive warn user, so I am doing this: If MyPath = Directory.GetDirectoryRoot(MyPath) Then 'Warn user End if MyPath is returned from a control like FolderBrowseDialog so I'm sure it cannot be an invalid path... Is it the best way you think?
  16. Windows 7 has a new feature which shows ProgressBar in TaskBar. There's a Windows API released by Microsoft which is a wrapper for .NET applications that allows .NET developers use these functions in their apps. I am not going to use it and just wanna know if there is any new functions in .NET Framework 4.0 RTM which allows us to use such functions naively in .NET?
  17. I really have no idea why there's no built-in function to detect platform, I need to know I am running on x64 or x86? Even in .NET Framework 4.0, there's no such thing! Well, my application is set to "Any CPU" Can I use: If IntPtr.Size = 8 Then 'x64() ElseIf IntPtr.Size = 4 Then 'x86 End If And make sure it will work OK on all conditions? Or you know a better way? Thanks
  18. Hi, There are 2 versions of .NET Framework 4: Full and Client Profile. I really don't know to which I should set my application platform. I know Client Profile is a small version of Full Framework. But how should I know if .NET Framework 4 Client Profile will fit the requirements of my application? If possible I prefer Client Profile. Thank you :)
  19. Hi, Nothing is returned, I am setting "SelectedItem" property, so it will just set the selected item for each node and will go forward and when finished, it's done :)
  20. Hi everyone, I am an intermediate programmer with a basic understanding of VB.NET, however, I am having a problem with a special loop named "recursive". I didn't learn this and now am having a problem here: To select the 3rd subitem/node inside a control named "CrumbBar", I have to: CrumbBar1.SelectedItem = CrumbBar1.Items(0).SubItems(0) CrumbBar1.SelectedItem = CrumbBar1.Items(0).SubItems(0).SubItems(1) CrumbBar1.SelectedItem = CrumbBar1.Items(0).SubItems(0).SubItems(1).SubItems(2) And go through all items, but I need to do this in a LOOP. And I don't know how many nodes I will have to go inside. So I wanna know how can I loop the above code? Someone told me this is a simple recursive loop programming task. Not easy to me, how should be that? Any help, please :)
×
×
  • Create New...