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
U

User 1172745

@User 1172745
About
Posts
8
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • opening a file with internet explorer from C# code?
    U User 1172745

    misterbear wrote: Is there such a thing as an internet explorer control available that I can embed easily? IE can be embedded as an ActiveX control within your application. If you add the "Microsoft Web Browser Control" COM Component (shdocvw.dll) to your Toolbox, you'll be able to insert that on your form. To visit a website, call the control's Navigate function. The Web Browser control is heavily documented on MSDN, and many examples exist on the 'net for showing some of the advanced things you can do with it.

    C# csharp question career

  • Listcontrol text alignment.
    U User 1172745

    Ooops, I misunderstood the original post, when I add really long lines, I experience the same behavior you do. I think what you're looking for is definitely possible, but this functionality isn't even available in the Win32 list control (to my knowledge). About the closest thing you could do with the standard control is to add tooltips. Other than that, I think your only choice is making your own custom list control.

    C# question

  • Listcontrol text alignment.
    U User 1172745

    If you add Items at design-time (for testing purposes only) through the "Items" collection (you'll have to add SubItems of the first item, just the way list controls work), do these show up right aligned? They do for me when I setup a sample list control through the designer, add columns, and add items. If they show up left aligned, even for fields that you know are right aligned, you've got bigger problems and someone else will have to pipe in with some thoughts (possibly bad COMCTL32???)... If, then, you run your program, only to see everything left aligned, it's pretty obvious that something else is either resetting or recreating the properties on your control. Expand out all the regions of your code and just search for anything related to your list control, paying special heed to anything that may be happening more than once. If you can't isolate it, in the worst case scenario, you can always delete the object off your form/control, and keep re-compiling/fixing errors until you're sure all the code related to the control is gone, then re-add it. I'm sure someone else has other ideas but these are just the ones I can think of.

    C# question

  • Listcontrol text alignment.
    U User 1172745

    I usually just use the designer to set up my list controls and setup column/header properties (title, alignment, and size) at that time. I've never yet had an instance in the programs I've developed where I didn't know how I wanted data aligned/formatted at design time. Now, one thing I've noticed in general about list controls is that it doesn't seem you can right-align the FIRST column in a list control, but I believe that's a global truth about list controls, and not something specific to WinForms. If at all possible, I would really recommend doing it through the designer. If it's not possible, I'd still recommend doing one through the designer and then look at the code that is generated and compare it with what you're doing. If you can't figure it out still, post some code that can be commented upon.

    C# question

  • "sizeof" in C#
    U User 1172745

    If I understand your code correctly, really all you're trying to do is loop for each element in your array. In C#, the number of elements within an array is stored within the "Length" property. You could do something like this, then: for(int i = 0; i < minX.Length; i++) ... You could do it using sizeof, as you've already discovered, but I don't think there's a way around doing that without marking the code as unsafe.

    C# help question csharp c++ tutorial

  • Setting default button in a user control
    U User 1172745

    Thank you for the reply. The first solution sounds extremely elegant, but I'll need to make sure on entry of any UserControl that I reset Form.AcceptButton to be the valid default button for whatever control I'm on. Not a big deal but seems like the maintenance of the field could get buggy in complex situations. The second solution seems like it will be what I need to try, and the ability to set the style conditionally, although I can't think of an instance where I'll need to use this now, seems like something I should try to add. Either way, thank you for your suggestions, much better than checking for Enter on each keypress of each field.

    C# csharp help question winforms algorithms

  • Setting default button in a user control
    U User 1172745

    Ok, clarification of some of the above: "I know on a standard WinForm with buttons, I can just set that Form's AcceptButton accordingly, but I do not see that as the solution for this problem." -- I can't even find an "AcceptButton" property except on my *Form*. It appears that the UserControls don't expose any of the behavior needed to make a default button work (someone please tell me I'm wrong =>). So what I did for now is made a event handler for KeyDown on each of the fields within my SearchControl user control, and any time an Enter is detected, I send the button a PressButton command. This seems to work, however, I would like it to show the button as a default button (extra border basically). Am I going to have to owner draw the button? I'm not opposed to that, it just seems like this is an awful lot of monkeying for something I could do in ATL very easily. Or does someone have the "correct" solution to this whole default button & user control problem? Maybe the solution involves "Man you are totally designing/coding that wrong, go grab this book on WinForm development." :) Thanks, -John

    C# csharp help question winforms algorithms

  • Setting default button in a user control
    U User 1172745

    Hi all. Making my first "big" C# WinForms app. Basically, I have a WinForm (called MainForm) that has a menu, and a tab control docked to take up the full area. Eventually the number of tabs will be dynamic based on how many "workspaces" a user has open but for now is static. Within the first tab page, I am inserting a custom control -- called TypeAContentControl. There may be several of these on different tab pages (depending if the user called for multiple instances). That control actually contains, you guessed it, yet another control, and also contains a treeview and a panel which will house a future control. The control that is housed within TypeAContentControl is called SearchControl. It's pretty basic, contains a radio set, a text box, and a single button (which is at the heart of my question). I can't seem to figure out how to make this the "default" button. I only need it default while the focus is within other fields of the SearchControl (ie, I want to type in my textbox, or be on my radio buttons and hit Enter to perform an action). The only time I seem to hit the code behind the button is if I tab enough times so that the button has the focus, and then hit spacebar or enter. If I'm on another field within SearchControl, I have to use the keyboard accelerator to hit my button. I know on a standard WinForm with buttons, I can just set that Form's AcceptButton accordingly, but I do not see that as the solution for this problem. Anyone have any clues as to what might help me out here? I've been Googling and searching the MSDN for a while now trying to figure this out and just not finding anything helpful. Any help would be appreciated. Thanks, -John

    C# csharp help question winforms algorithms
  • Login

  • Don't have an account? Register

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