Jump to content
Xtreme .Net Talk

stumper66

Members
  • Posts

    16
  • Joined

  • Last visited

Everything posted by stumper66

  1. are you using cross-theading? If the thread that's adding the rows is not the UI thread, I would guess that's the cause.
  2. 0x80070005 = 2,147,942,405. Int.MaxValule returns: 2,147,483,647 As you can see, if I were to convert it to an Int, it would truncate the numbers, as MaxValue is 458,758 lower than my number.
  3. I have a console application. I would like to use uint for the exit code, eg. Environment.Exitcode = 0x80070005 Is there a method for returning unsigned integers or long integers? The reason is, I'm catching exceptions and want to return the native windows error code, such as System.UnauthorizedAccessException: Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
  4. can you post sample code?
  5. I am running Windows 7 x64 and I can run it, as long as you change it from any CPU to x86. I see what the problem is, however I haven't been able to find a solution either :(
  6. How about this: ' mpPlayer.CurrentPosition = 27.5472404 Dim CurrentPosition As String = String.Format("{0:0,#}", mpPlayer.CurrentPosition) ' Will Display as 27.5
  7. I would just follow the above suggestion, and maybe have it search for any exempt words, and call .ToLower on those.
  8. How about handling the SelectedIndexChanged event on the tabcontrol to scroll the textbox to the charat? Private Sub TabControl1_SelectedIndexChanged(ByVal Sender As Object, ByVal e As EventArgs) Handles TabControl1.SelectedIndexChanged Dim sel As Integer = TabControl1.SelectedIndex Dim txt As Textbox = CType(TabControl1.Controls("TextBox" & (sel + 1).ToString()), TextBox) txt.ScrollToChar() End Sub
  9. Perhaps you'd want to use System.Diagnostics.StopWatch ? http://msdn.microsoft.com/en-us/library/system.diagnostics.stopwatch.aspx
  10. Dim myArr() As String = {"6200", "6600", "7900", "8600", "9900"} Dim myInt As Integer = 7700 Dim ClosestInt As Integer = Math.Abs(CInt(myArr(0)) - myInt) Dim usedArr As Integer = 0 For i As Integer = 1 To myArr.Length - 1 Dim TempInt As Integer = Math.Abs(CInt(myArr(i)) - myInt) If TempInt < ClosestInt Then ClosestInt = TempInt usedArr = i End If Next MessageBox.Show(String.Format("Closest number: {0:#,0}", CInt(myArr(usedArr))))
  11. Are you catching any events from the listview? I may know what you're talking about, if you are executing e.handled = true on the keydown or mousedown events. I had a similar problem with textboxes. I wanted to handle the return button. When I handled the keypressdown and did e.handled = true from there, I got the beep. The solution was to create a global bool, then have the keydown event set the bool to true, then handle the keypress arg to check if the bool is true, then set the e.handled = true in that event. BTW, I really doubt this is a Vista specific problem. Perhaps the sound doesn't work on your XP box?
  12. I don't know c++ at all, but have a few questions. Why are you making button1 create a new thread? Why not just call folderDialog() directly from button1? I suspect the reason the FBD shows behind the form is because it's being called from a non-UI thread (illegal cross-threading). If you need to have the code execute from a background thread, then use delegates to display the FBD.
  13. I use DGVs all the time and think they are just fine, speed wise. Are you calling .BeginEdit() and .EndEdit() when loading lots of data records? If not, I can see why it's slow, as it's redrawing with every data row that's added.
  14. Hi. Not sure if you figured it out yet, but perhaps the code below accomplished what you are trying to do? string[] args = Environment.GetCommandLineArgs(); if (args.Length > 1) { string FileToLoad = args[1]; string BasePath = Application.ExecutablePath; if (!BasePath.EndsWith("\\")) BasePath += "\\"; //If FileToLoad is the name of a textfile, just append it to the base path string FileToLoad = BasePath + FileToLoad; //do stuff to load the file into the textbox } [/Code]
  15. This is how I do it: Old: strSql = "Insert Into Individual (Name, FirstName) Values ('" & strINDIName & "', '" & strINDIFirstName & "')"[/Code] Change to: [Code] strSql = "Insert Into Individual (Name, FirstName) Values ('" & strINDIName.Replace("'", "''") & "', '" & strINDIFirstName.Replace("'", "''") & "')"[/Code] Or to clean it up: [Code] strSql = String.Format("Insert Into Individual (Name, FirstName) Values ('{0}', '{1}')", _ strINDIName.Replace("'", "''"), _ strINDIFirstName.Replace("'", "''"))[/Code]
  16. I want to have individual tool tips on my tree nodes in a TreeView. Using the following works great: treeServers.Nodes[0].ToolTipText = "tool tip"; [/Code] However, I want to have a delay before the tool tip appears (similar to System.Windows.Forms.ToolTip and .AutoPopupDelay), but I can't figure out how to implement it. Any ideas would be welcomed. I'm using VS 2008 and C#.Net 2.0
×
×
  • Create New...