Search:

Type: Posts; User: jmcilhinney

Page 1 of 13 1 2 3 4

Search: Search took 5.08 seconds.

  1. Re: Auto resize ListView columns to fit either the header text or content

    Team effort, baby!

    Actually, it occurred to me that that could be improved a little more. If there are no items then we can use the existing instance method, so we only need to use our own code if...
  2. Re: Auto resize ListView columns to fit either the header text or content

    You could even implement that code as an extension method:

    Imports System.Runtime.CompilerServices

    Public Module ListViewExtensions

    <Extension>
    Public Sub AutoResizeColumns(source...
  3. Re: Auto resize ListView columns to fit either the header text or content

    I just tested and the code I posted will indeed cut off a long column header if all subitems in that column are shorter. It seems an oversight that there isn't an option to consider both header and...
  4. Re: Auto resize ListView columns to fit either the header text or content

    I haven't tested it specifically but wouldn't you just need to do this:

    List_View.AutoResizeColumns(If(List_View.Items.Count = 0,
    ...
  5. VS 2019 Re: Need help with DrawEllipse() and Me.Refresh() and Label1.text

    They lasted longer than most.
  6. Re: How to get combo box to show .exe files and not full path

    That's exactly what I implying in post #4 that you apparently ignored.
  7. VS 2019 Re: Need help with DrawEllipse() and Me.Refresh() and Label1.text

    You mean exactly what I did in post #9?

    There is no such thing as an Ellipse, unless you define it yourself. Given that the DrawEllipse method takes a Rectangle as an argument, storing Rectangles...
  8. Re: Show firstname and familyname after login.

    As for the issue, the problem is that you're not getting any data out of your DataTable. You're just using the values the user entered. If you want to use the data you retrieved then you have to...
  9. Re: Show firstname and familyname after login.

    For the record, you shouldn't really use that combination of field names. You should either use firstName and lastName or givenName and familyName. That's because there are some cultures where the...
  10. VS 2019 Re: Need help with DrawEllipse() and Me.Refresh() and Label1.text

    Updating the Label while you draw the ellipses in a loop is a very bad idea too. That loop should execute so quickly that you shouldn't really be able to see any single number in the Label anyway. If...
  11. VS 2019 Re: Need help with DrawEllipse() and Me.Refresh() and Label1.text

    The Paint event works exactly as it should. If your code doesn't work then it's your code that is wrong but you haven't shown us your code so we have to guess what might be wrong with it. If you just...
  12. Re: How to get combo box to show .exe files and not full path

    Also, don't add items in a loop like that. At the very least, add all items in one go with a single call to AddRange. Better still, bind the data by setting the DisplayMember, ValueMember and...
  13. VS 2019 Re: [RESOLVED] Webbrowser control does not load HTML if passed as command line parame

    Try using the DocumentCompleted event of the WebBrowser. You'd have to add some conditional logic so that it only happened the first time.
  14. VS 2019 Re: Webbrowser control does not load HTML if passed as command line parameter

    Try loading it in the Shown event handler instead of the Load event handler.
  15. Replies
    5
    Views
    201

    Re: sqlite search all columns

    The potential issue with concatenating fields is that you may end up being able to match a value that doesn't actually exist in any column. It may be possible based on the data and, if it is, you can...
  16. Replies
    2
    Views
    156

    VS 2019 Re: Wrong Menustrip

    There is only one MenuStrip. What I suspect has happened is that you have created a new project and you have used the .NET template rather than the .NET Framework template. This root issue has come...
  17. Replies
    5
    Views
    201

    Re: sqlite search all columns

    As for the question, if you know that you want to compare every column then the proper way to do it is to write SQL code that compares every column. It sounds like you're hoping for something like a...
  18. Replies
    5
    Views
    201

    Re: sqlite search all columns

    For future reference, don't post code snippets with huge wads of leading whitespace on every line but the first. It always amazes me how many people put no thought into this. If you select a section...
  19. Replies
    7
    Views
    233

    VS 2010 Re: Deadlock in Background Worker

    Add some logging to your code so you can see what's happening when and where. You can't just use the debugger when you have multiple threads because it's too hard to work out what's going on in what...
  20. Replies
    7
    Views
    233

    VS 2010 Re: Deadlock in Background Worker

    The ConcurrentQueue class has no Clear method but, if you want to clear it, you can just dequeue in a loop as I demonstrated. Here's an extension method that will allow you to call Clear like you...
  21. Replies
    1
    Views
    345

    Re: Oldest Date

    This is really a SQL question. You can use SELECT TOP 1 to get the first record in a result set so you simply need to query your table and sort by the date column in ascending order to make the...
  22. Re: How to create a leadger system in c#

    We're not here to teach you how to program from scratch. What have you done and where are you stuck? If you want to create such a system then presumably you know how it works so put something into...
  23. Replies
    7
    Views
    233

    VS 2010 Re: Deadlock in Background Worker

    Do it like this:

    Private actionList As New ConcurrentQueue(Of String)

    Private Sub AddAction(action As String)
    actionList.Enqueue(action)
    End Sub

    Private Sub Button1_Click(sender As...
  24. VS 2019 Re: System.NullReferenceException Error

    Indexing the Controls collection returns a Control reference, so you can only access members of the Control class via that reference. As is always the case, if the actual object referred to is a more...
  25. Replies
    8
    Views
    257

    Re: Adding a label to specific Images

    It's a different solution but it's not inherently "cleaner". What if you don't want the image obscured by the text?

    Also, this is the VB.NET forum and you have provided C# code. Not a criminal...
  26. Replies
    8
    Views
    257

    Re: Adding a label to specific Images

    You do what I said. You define a type that had those properties and then you create an array of that type. Creating an array is the same regardless of the type and you obviously already know how to...
  27. Replies
    8
    Views
    257

    Re: Adding a label to specific Images

    Use a single Label, set AutoSize to False, change the Size so it is the full width of the available area and set TextAlign to MiddleCenter or, if some of the descriptions may be multi-line, TopCenter.
  28. Replies
    8
    Views
    257

    Re: Adding a label to specific Images

    Instead of using a Bitmap array, you should define a type that has a Bitmap property and a String property and then create an array of that type. You can then create instances of that type and put...
  29. VS 2010 Re: Another window doesnt popup though it should

    Yes you did, but I didn't ask you "what". I asked you "why". You don't have to answer my question if you don't want to but I'm not interested in helping people to do the wrong thing so if you can't...
  30. Replies
    428
    Views
    10,617

    Re: The US fragile democracy Exposed

    I doubt it. My impression, based largely on the fact that he seems to want to criticise Biden for every little thing even before this while pretty much giving Trump a pass, is that he is someone who...
  31. VS 2010 Re: Another window doesnt popup though it should

    Why? Is this a "because I can" sort of thing or are you actually trying to achieve something useful? If the latter, you should explain what that is because it's hard to imagine that there isn't a...
  32. VS 2017 Re: Toggle between two images based on filename

    The point of an example is to demonstrate a principle and you then implement the principle in your own scenario. An "example" of what I described would be the whole thing, so it wouldn't be an...
  33. Replies
    428
    Views
    10,617

    Re: The US fragile democracy Exposed

    There have been calls on the left to start a People's Party behind the likes of Bernie Sanders. I think that that would be a good thing in principle but the reality is that, if that happened, the...
  34. Replies
    428
    Views
    10,617

    Re: The US fragile democracy Exposed

    Indeed. I don't know whether they were just parroting Trump himself but I've heard plenty of his supporters claim that the fact that his rallies were so well and enthusiastically populated is...
  35. VS 2019 Re: System.NullReferenceException Error

    If the TabPage was added to the TabControl in the designer then there will be a field for it, just like other controls. In that case, you would generally refer to the TabPage by that field, e.g.
    ...
  36. VS 2019 Re: System.NullReferenceException Error

    Indexing the Controls collection with a name that doesn't exist will return Nothing, and you can't get a property of Nothing. Why do you think that ComboBoxes will just appear out of thin air? If you...
  37. Replies
    428
    Views
    10,617

    Re: The US fragile democracy Exposed

    I agree but I will say that an ad hominem attack and an ad hominem fallacy are two different things. I'm not above calling people stupid if I think they're stupid, as evidenced above, but I generally...
  38. VS 2017 Re: Toggle between two images based on filename

    I would not be loading the file every time unless you're confident that you'll only toggle a small number of times. Otherwise, you'll be creating a large number of Image objects from the same. In...
  39. Re: Error on filling ComboBox from Excel named range.

    When any exception that you're not sure about is thrown on a compound statement, the very first thing to do is to break up the statement into parts and see exactly where the exception is thrown. That...
  40. Re: Error on filling ComboBox from Excel named range.

    Error messages are text and should be posted as text. We shouldn't have to resize an image and try to read the blurry screenshot when, if I'm not mistaken, the Exception Assistant window even has a...
Results 1 to 40 of 500
Page 1 of 13 1 2 3 4



Click Here to Expand Forum to Full Width