IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-04-02 18:00:08
Channels: 41
Logged Lines: 6229042
Size: 1806.44 MB
Powered by
Channel Info
Network: freenodeChannel: #csharp |
Search in www.irclog.org
Log from #csharp at freenode 2006-08-05
[00:02]<zzd-wjzc>zomg generics 4 life!!!
[00:04]<zgzzcygnv>w0rd!
[00:05]<gjrvcxnne>are there any non-api calls i can make to check the diplay depth?
[00:25]<zzd-wjzc>GoatCheez: How can you not make a call to an API?
[00:25]<zzd-wjzc>you mean to win32?
[00:25]<zzd-wjzc>api?
[00:26]<zzd-wjzc>Might be able to look it up via WMI.
[00:26]<gjrvcxnne>i meant win32 api
[00:27]<bfrgmnsv>DllImport for Win32API
[00:28]<bfrgmnsv>C# has some (more?) support for WMI
[00:28]<gjrvcxnne>lol... little late... actual question is how to check the display depth
[00:29]<zzd-wjzc>google says:
[00:29]<zzd-wjzc>http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/cim_videocontrollerresolution.asp
[00:31]<gjrvcxnne>how do i use wmi stuff lol
[00:31]<zzd-wjzc>there's plenty of tutorials
[00:32]<gjrvcxnne>ahhhh System.Management... that's what I was looking for lol
[00:32]<gjrvcxnne>wtf... i don't have that... is WMI 2.0 onlyt?
[00:33]<zzd-wjzc>dunno
[00:33]<lnvnzxu>is System.Management.dll referenced?
[00:33]<gjrvcxnne>ah, it's not.... i just have to manually add a reference to it
[00:33]<gjrvcxnne>as peter just pointed out lol
[00:37]<gjrvcxnne>WMI doesn't look like it's going to serve me well.... to complicated... .i'll just look for a simple win32 api call...
[00:44]<n2nzv>Obviously a simple question, but I cannot find it in MSDN: I want a one-line textbox to fire an event (call my OnEnter() method) when I press enter in the textbox
[00:44]<gjrvcxnne>ahhhhh, good ol GetDeviceCaps.... lol.... it seems like I tend to do a LOT of win32 api calling in .net lol
[00:45]<gjrvcxnne>ebert: use even OnKeyDown and call your event when the key is enter and the base for everything else?
[00:46]<n2nzv>yeah maybe - what's the base here? Should I return true/false or somehow indicate if I handled the event?
[00:47]<n2nzv>I thought about this: Make a button and set its DialogResult to OK, hopefully making it respond to Enter (but hopefully not closing the dialog ;). What about that - do you think that could work?
[00:48]<gjrvcxnne>i don't understand what your workaround is sayin
[00:48]<gjrvcxnne>base.OnKeyDown(sender,e)
[00:48]<gjrvcxnne>call that if the key isn't return
[00:48]<gjrvcxnne>(in your OnKeyDown event)
[00:48]<gjrvcxnne>i'm pretty sure that's the kosher way
[00:51]<n2nzv>'base' would here be System.Windows.Forms.Form, right?
[00:51]<n2nzv>So all keypresses (except enter) in the textbox would be sent to the dialog?
[00:53]<gjrvcxnne>use the keyword base
[00:53]<gjrvcxnne>and no, it wouldn't be it would be System.Windows.Forms.TextBox
[00:53]<n2nzv>Only if I make a subclass of TextBox
[00:54]<gjrvcxnne>all kepresses except enter would be send to the default keypress handler for textbox
[00:54]<gjrvcxnne>hmmmm
[00:55]<n2nzv>Wait - think I found it - TextBox has an event called 'Enter'
[00:55]<gjrvcxnne>uhhh disregard anything i've said... it's friday and it's late
[00:55]<n2nzv>ok ;)
[00:55]<[dam]>the Enter event is when the control get focused..
[00:55]<n2nzv>Ah - damn ;)
[00:57]<[dam]>for your problem you have to use the onkeypress event and in that event a simple if (e.KeyChar == '\r')
[00:57]<n2nzv>Okay, I hooked into the KeyPress event. I can see that KeyPressEventArgs has a 'Handled' property
[00:57]<n2nzv>that must be the way to tell if TextBox should (also) handle the event (i.e., if it was not enter)
[00:57]<gjrvcxnne>ebert: yeah there ya go... if the key is enter, set that to true and do your stuff, otherwise set it to false and do nothing
[00:58]<[dam]>... just use the e.KeyChar..
[00:58]<n2nzv>okay, this sounds like the way to go. Thanks
[00:58]<[dam]>de nada !
[00:59]<gjrvcxnne>i can't believe i told him to call base.... what the hell was i thinking..... it's gotta be all this automation crap i'm doing... soab
[01:00]<[dam]>bahh if you override the event you have to call the base .. if not every other keys would be disabled..
[01:02]<gjrvcxnne>that's what I was thinking lol
[01:02]<n2nzv>Hey, it's working :-)
[01:03]<n2nzv>The textbox is a "commandline", and I don't want to use the mouse or TAB everytime I finish a command line
[01:07]<sljjcnq>good night all
[01:12]<kjr>bah, google sucks
[01:17]<rxrcr>wow, first I find out 911 jokes are funny now, then I find out google sucks
[01:17]<rxrcr>been kindof a weird day
[01:18]<kjr>911 jokes? what, prank-calling dispatchers?
[01:18]<rxrcr>9/11/01
[01:18]<kjr>"I need an ambulence... to poop on" - Conan O'Brien
[01:19]<kjr>chaka: matters of great concern should be treated lightly
[01:19]<zgzzcygnv>kog - jokes about the WTC attacks
[01:19]<kjr>AnarkiNet: yeah, I was being sarcastic
[01:20]<kjr>AnarkiNet: why shouldn't they be funny, apparently we can laugh about concentration camps from various nations
[01:20]<kjr>ooh, then there was M*A*S*H
[01:20]<pz2>isn't it 50 years before pain and misery are funny?
[01:20]<kjr>that's how many people deal with uncomfortable subjects - humor
[01:21]<rxrcr>Kog, a friend was opening some old boxes in his office, reached for his box cutter and said, "Hey, I could take down a plane with this"
[01:21]<zgzzcygnv>lol
[01:21]<kjr>chaka: and?
[01:21]<kjr>it's probably true, sadly enough
[01:22]<zgzzcygnv>btw, M*A*S*H is probably one of my top 5 favourite shows of all time, heh
[01:22]<rxrcr>there's got to be some sort of theorem that explains exactly how long it takes for a statement like that to become funny in the common conscienceness of the US
[01:23]<kjr>chaka: humor is entirely personal
[01:24]<kjr>chaka: people were making jokes about that in front of the TSB on sept 13th of 2001
[01:24]<zgzzcygnv>TSB?
[01:24]<kjr>whoops, TSA
[01:24]<kjr>I downgraded them a letter
[01:25]<zgzzcygnv>lol
[01:25]<kjr>my assertion is thus: despite all the chest thumping and nonsensical politics I'm still as easy as ever to kill
[01:28]<kjr>hrm, perhaps I should perpetuate a myth of invicibility instead
[01:29]<zgzzcygnv>looks like you might have made a grave error there, kog. har har har
[01:29]<kjr>AnarkiNet: OH SHNAP!
[01:29]<zgzzcygnv>:P
[01:30]<zj2-wzc>Kog: I think their were 9/11 jokes and photoshops on fark.com within 6 months.
[01:30]<zj2-wzc>some of the quite distasteful yet absurdly funny at the same time.
[01:31]<kjr>rob-wrk: it has also been said that laughter is the only armor against sadness
[01:32]<kjr>rob-wrk: I was always rather curious how a box cutter can truly be that dangerous
[01:32]<kjr>it must be within the will to power
[01:32]<zj2-wzc>"It takes a big man to cry, but it takes a bigger man to laugh at that man." -- Jack Handy ;)
[01:32]<rxrcr>Kog, back, boss came to talk with me :(
[01:32]<kjr>chaka: and tell you that 9-11 jokes just werent Office appropriate?
[01:33]<rxrcr>haha
[01:33]<rxrcr>no, completely unrelated, and unfortunately had nothing to do with consuming beer
[01:35]<kjr>oh silly enigmail, whyfor do you suck
[01:35]<kjr>chaka: were you drinking at work again?
[01:35]<rxrcr>Kog, wish I was.







