Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Trevortni

@Trevortni
About
Posts
218
Topics
14
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Changing CommandText changes Parameters
    T Trevortni

    Mycroft Holmes wrote:

    worst things MS has inflicted on us, they allow a new developer to get data to the UI with almost no knowledge of how it was achieved.

    And this is a bad thing why? Anyway, the problem is not that I don't know what I'm doing. I know exactly what it should look like, and know that if I can get the screen to look like this, it will work as expected. The internals of the Table Adapter are not the problem; the problem is the Designer changing parameters without my permission. If you don't know how to convince the UI to not drop data, man up and confess your ignorance rather than using it as an excuse to make yourself sound like an elitist snob. That does nobody any good, and makes you look stupid. Allow me to demonstrate:

    Bad:

    HAHAHAHA!!!! LOSER!!!! ONLY N000BS USE M$ COMPONENTS!!!! ROLL YOUR OWN N0000B!!!!1111ONEONE

    Good:

    Oooh, sorry, I never use TableAdapters, I've never had anything but problems with them, and in my experience, most people around here feel the same. Have you considered making your own or implementing one from somewhere else? It always seems to work out easier for me in the long run.

    You see the difference? They both offer the same advice, but the second one actually comes across as advice rather than an elitist slam. ---- All ranting aside, I do appreciate your advice, and while it doesn't look like implementing some other solution is an immediately viable solution (I'm not the only person in this code, and the senior programmer who originally implemented this would seem to take offense at the idea that he has no idea what he's doing), I will keep it in mind should I come across database needs more complex than can be solved through whatever it takes to get this UI in line (which looks like my only option might be to let VS destroy my Parameters and then manually rewrite them all.... sigh....)

    Database csharp visual-studio tutorial question

  • Changing CommandText changes Parameters
    T Trevortni

    Yes, I understand this, and I am quite fine with this. The problem is, VS changes the Parameters for me, instead of giving me the option to specify the Parameters myself.

    Database csharp visual-studio tutorial question

  • Changing CommandText changes Parameters
    T Trevortni

    I'm trying to edit the CommandText for the Insert Command in a TableAdapter in the Designer in vb.net. Whenever I make changes to the CommandText, Visual Studio (2008) automagically changes the Parameters to a Collection consisting of one Parameter that existed before editing the Command, immersed in a sea of complete garbage Parameters, and then I either have to undo (unless this was the first thing I tried editing, in which case I have to close the Designer to discard changes and reopen it) or manually change ALL the Parameters back to something that isn't complete garbage. Has anybody seen anything like this, or know how to stop Visual Studio from murdering my carefully tended Parameters? Any way to change the CommandText without finding yet another reason to curse the name of M$ would be greatly appreciated.

    Database csharp visual-studio tutorial question

  • ContextMenuStrip not highlighting Items according to mouse movement
    T Trevortni

    I have a ContextMenuStrip that I am showing programmatically in response to a button being clicked. Everything works as expected, except that the Items in the menu do not respond to being moused over. Whether the mouse button is up or down, mousing over the menu has no visible effect, and releasing the mouse button does not select an Item, as expected. Performing a full click on an Item does still activate the Item, however. Here's my code for showing the ContextMenuStrip:

    Protected Overrides Sub OnMouseDown(ByVal e As System.Windows.Forms.MouseEventArgs)
    MyBase.OnMouseDown(e)
    If Enabled Then
    m_MouseDown = True
    If m_State > ButtonState.MousePressed Then
    m_State = ButtonState.MousePressed
    End If
    Invalidate()
    If DropDown IsNot Nothing AndAlso DropDown.Items.Count > 0 Then
    If ShowMenu Then
    ShowMenu = False
    ElseIf arrowRect.Contains(PointToClient(MousePosition)) Then
    ShowMenu = True
    m_MouseHeldWhileOpened = True
    DropDown.Capture = True
    End If
    End If
    End If
    End Sub

    Protected Property ShowMenu() As Boolean
    Get
    Return m_showMenu
    End Get
    Set(ByVal value As Boolean)
    If value <> m_showMenu Then
    m_ShowMenu = value
    If m_ShowMenu Then
    m_DropDown.Show(Me, GetDropDownSpawnPoint, DropDownDirection)
    m_State = ButtonState.MenuUp
    If m_DropDown.ClientRectangle.Contains(PointToScreen(MousePosition)) Then
    m_DropDown.Capture = True
    End If
    Else
    m_DropDown.Close()
    ElevateState()
    End If
    End If
    End Set
    End Property

    I have tried a number of different ideas to get the menu to respond correctly, some of which attempts are still evident in the code here. If any help would be forthcoming, it would be greatly appreciated - nobody else on Google seems to have experienced this problem. Thank you in advance for any help you can offer.

    Visual Basic help

  • MessageBox.Show not raising HelpRequested event
    T Trevortni

    OH. MY. GOODNESS. So I started checking the source code for the MessageBox.Show in Reflector. As it turns out, if you don't specify the Owner, as you aren't allowed to do when you want to handle HelpRequested yourself, it uses UnsafeNativeMethods.GetActiveWindow() to determine who to send the HelpRequested to. The moment I saw this, I knew what was going on. The application I'm working in has a splash screen that shows the status to the user that is shown in the .dll. THAT is the ActiveWindow. When I forced it down and called Activate on my Form just before this code, it worked.

    Trevortni wrote:

    Private Function MethodName() As Boolean

    Me.Activate()

    AddHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
    Select Case MessageBox.Show("Text", "Title", MessageButtons.YesNoCancel, _
    MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 0, True)
    Case MsgBoxResult.Yes
    ' Do stuff
    Case MsgBoxResult.No
    ' Do stuff
    Case MsgBoxResult.Cancel
    RemoveHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
    Return False
    End Select
    RemoveHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
    End Function
    '
    '
    Private Sub MsgBoxHelpRequested(ByVal sender As Object, _
    ByVal hlpevent As System.Windows.Forms.HelpEventArgs)
    ' Breakpoint that finally gets hit
    ' More code
    End Sub

    Visual Basic question com debugging help tutorial

  • MessageBox.Show not raising HelpRequested event
    T Trevortni

    This code is actually getting executed by way of a .dll which Raises an event back on the calling Form that leads to this code. If I move this code back to just before where the code heads out to the .dll, it works. Could something be going on behind the scenes due to the .dll call that could be causing this?

    modified on Thursday, May 13, 2010 4:58 PM

    Visual Basic question com debugging help tutorial

  • MessageBox.Show not raising HelpRequested event
    T Trevortni

    Sorry to snap at you, I got a little annoyed yesterday at people telling me what to do and posting essentially my exact code. Your code isn't the current iteration of my exact code, but it's been tried. Unsuccessfully. :( :( :(

    Visual Basic question com debugging help tutorial

  • MessageBox.Show not raising HelpRequested event
    T Trevortni

    Actually, I seem to be the only one it doesn't work for. And only in this project. I've copied and pasted my exact code to a new Project, and after taking care of all the blue underlines, it works perfectly. I can't figure out why it's not working in the the real application; the only thing I can think is that the event is never being fired from the MessageBox somehow - I've added handlers for the event in every possible way I can think of, and none of them ever get called. If only I could fire the event myself or break execution when the event is called, it would be so tremendously helpful, but I neither of these seem possible, and I'm getting extremely frustrated.

    Visual Basic question com debugging help tutorial

  • MessageBox.Show not raising HelpRequested event
    T Trevortni

    Okay, I'm not sure why you're showing a second MsgBox to display the MsgBoxResult of the first one in the first function, but the second function doesn't help me because it's yet another variation of what I've been trying to do that I have already determined does not work for me.

    Visual Basic question com debugging help tutorial

  • Save Excel
    T Trevortni

    I didn't realize Excel was so badly endangered, but if you think this code will somehow manage to save it, then by all means do what you can. EDIT: Sorry, couldn't resist.

    Visual Basic help

  • MessageBox.Show not raising HelpRequested event
    T Trevortni

    I have a form that is showing a MessageBox using MessageBox.Show, and trying to receive events from the Help button on the MessageBox so I can execute my own code. The Microsoft documentation shows how to do this; however, using what is suggested does not work. Here's a shortened version of my code:

    Private Function MethodName() As Boolean

    AddHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
    Select Case MessageBox.Show("Text", "Title", MessageButtons.YesNoCancel, _
    MessageBoxIcon.Question, MessageBoxDefaultButton.Button2, 0, True)
    Case MsgBoxResult.Yes
    ' Do stuff
    Case MsgBoxResult.No
    ' Do stuff
    Case MsgBoxResult.Cancel
    RemoveHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested
    Return False
    End Select
    RemoveHandler Me.HelpRequested, AddressOf Me.MsgBoxHelpRequested

    End Function
    '
    '
    Private Sub MsgBoxHelpRequested(ByVal sender As Object, _
    ByVal hlpevent As System.Windows.Forms.HelpEventArgs)
    ' Breakpoint that never gets hit
    ' More code
    End Sub

    I posted this question yesterday on stackoverflow[^], where we get into quite a spirited discussion, with a bunch of suggestions that ultimately never seemed to pan out, if you want to see what I've already tried. Currently I'm working on seeing if there's any way to determine if the event was even raised in the first place - either by trying to manually raise the event and see if my code gets called, or seeing if there's any way to break on an event. Does anybody have any suggestions? Oh, and by the way, Chris Maunder: CodeProject is much better designed than StackOverflow. Reading stackoverflow is a pain on the eyes, trying to comment is a pain in the neck - coming back home here is such a relief. While the people over there are just as nice as here, I wish I had thought to check here yesterday.

    Visual Basic question com debugging help tutorial

  • I Would Like To Propose a Game
    T Trevortni

    This is madness! - 300

    The Lounge game-dev

  • I Would Like To Propose a Game
    T Trevortni

    I am serious. And don't call me Shirley. - Airplane

    The Lounge game-dev

  • You know you're a geek when...
    T Trevortni

    John Stewien wrote:

    your 2 yr old daughter

    John Stewien wrote:

    can't speak English yet.

    Because you insist that she be fluent in Klingon, Elven, and Assembly before being exposed to such an irrelevant language.

    The Lounge c++ adobe architecture

  • You know you're a geek when...
    T Trevortni

    Marc Clifton wrote:

    You need a woman in your life!

    Are you responding to the quote you included, or to the thread itself?

    The Lounge c++ adobe architecture

  • [Mathematics] Sum of angles of triangle [Updated]
    T Trevortni

    I remember seeing this covered in Sphereland[^], a sequel to the classic Flatland, in which one of A. Square's descendants begins to explore Flatland, and discovers many interesting things about this world, including, by way of the very divergence of angles you're referring to, the fact that Flatland is in actuality Sphereland. However, the divergence from 180 degree angles can only be detected between objects that are very far apart - such as stars, as you mentioned. This can only be explained through curvature of space, as others have already mentioned in several subthreads. I hope this helps.

    The Lounge question learning

  • Losing your temper
    T Trevortni

    Pete O'Hanlon wrote:

    "Look out, he's got a bouffant."

    Bulbous?

    The Lounge question learning csharp linq testing

  • Pranking the office: fake Blue Screen of Death
    T Trevortni

    No, no, no. The best is when you combine this with screen flipping.

    The Lounge database performance help announcement

  • Whats everyone reading(for pleasure) nowadays?
    T Trevortni

    The Tanakh and any number of books on learning Hebrew. I'm loving it!

    The Lounge com question learning

  • Whats everyone reading(for pleasure) nowadays?
    T Trevortni

    Personally, I found it rather grating when Ayn Rand inserted herself as narrator into the person of the radio announcer talking about the train crash. Other than that, great!

    The Lounge com question learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups