|
In a usercontrol i create a ListView control with a handler for the click event. In this usercontrol i create a new form and i send the reference of my ListView to it and also attach it to the Controls of the form(Obs: my ListView control isn't in the Controls of my usercontrol, it's only created there).
At runtime when i select an item from the ListView the handler method is executed, then the form closes and when i reopen the form(with the same attached ListView) when i try to select an item the same handler method isn't executed(Obs: Before I close the form I erase the reference of the ListView from the Controls of the form so the dispose method won't affect it)
Code:
public class myusercontrol: System.Windows.Forms.UserControl
{
....
private void InitLv()
{
this.lv = new System.Windows.Forms.ListView();
lv.Click+=new EventHandler(lv_Click);
.......
}
private void lv_Click(object sender, System.EventArgs e)
{
.......//this method is executed only once
}
private void btn_drop_Click(object sender, System.EventArgs e)
{
MyForm popup = new MyForm ();
popup.AddLv(this.lv);
....
}
}
In MyForm:
...
public void AddLv(System.Windows.Forms.ListView lv)
{
this.SuspendLayout();
this.Controls.Add(lv);
this.ResumeLayout(false);
}
public void CloseForm()
{
RemoveLVTV();// this remove de lv from Controls
this.Close();
}
nycadr
|
|
|
|
|
When you thought your thread had not posted properly, did it not occur to CHECK before posting it 3 times?
|
|
|
|
|
In a usercontrol i create a ListView control with a handler for the click event. In this usercontrol i create a new form and i send the reference of my ListView to it and also attach it to the Controls of the form(Obs: my ListView control isn't in the Controls of my usercontrol, it's only created there).
At runtime when i select an item from the ListView the handler method is executed, then the form closes and when i reopen the form(with the same attached ListView) when i try to select an item the same handler method isn't executed(Obs: Before I close the form I erase the reference of the ListView from the Controls of the form so the dispose method won't affect it)
Code:
public class myusercontrol: System.Windows.Forms.UserControl
{
....
private void InitLv()
{
this.lv = new System.Windows.Forms.ListView();
lv.Click+=new EventHandler(lv_Click);
.......
}
private void lv_Click(object sender, System.EventArgs e)
{
.......//this method is executed only once
}
private void btn_drop_Click(object sender, System.EventArgs e)
{
MyForm popup = new MyForm ();
popup.AddLv(this.lv);
....
}
}
In MyForm:
...
public void AddLv(System.Windows.Forms.ListView lv)
{
this.SuspendLayout();
this.Controls.Add(lv);
this.ResumeLayout(false);
}
public void CloseForm()
{
RemoveLVTV();// this remove de lv from Controls
this.Close();
}
|
|
|
|
|
In a usercontrol i create a ListView control with a handler for the click event. In this usercontrol i create a new form and i send the reference of my ListView to it and also attach it to the Controls of the form(Obs: my ListView control isn't in the Controls of my usercontrol, it's only created there).
At runtime when i select an item from the ListView the handler method is executed, then the form closes and when i reopen the form(with the same attached ListView) when i try to select an item the same handler method isn't executed(Obs: Before I close the form I erase the reference of the ListView from the Controls of the form so the dispose method won't affect it)
Code:
public class myusercontrol: System.Windows.Forms.UserControl
{
....
private void InitLv()
{
this.lv = new System.Windows.Forms.ListView();
lv.Click+=new EventHandler(lv_Click);
.......
}
private void lv_Click(object sender, System.EventArgs e)
{
.......//this method is executed only once
}
private void btn_drop_Click(object sender, System.EventArgs e)
{
MyForm popup = new MyForm ();
popup.AddLv(this.lv);
....
}
}
In MyForm:
...
public void AddLv(System.Windows.Forms.ListView lv)
{
this.SuspendLayout();
this.Controls.Add(lv);
this.ResumeLayout(false);
}
public void CloseForm()
{
RemoveLVTV();// this remove de lv from Controls
this.Close();
}
nycadr
|
|
|
|
|
Hello to all,
I have to make RTP sreaming. By doing googling i foung oRTP library. This is build in C. I also found ortp.dll. But now i don't know how to use this dll in C#.net.
This dll is not a COM object. So, we can't add reference of this.
Plz help me.
Regards,
Divyang Mithaiwala
|
|
|
|
|
You can call into a C dll using P/Invoke (http://pinvoke.net). If the dll heavily uses STL, MFC, ATL or some other C++ library, your best bet might be to use C++/CLI to call the method.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Connor's Christmas Spectacular!
Judah Himango
|
|
|
|
|
Hi!
I have a user control with a PictureBox control. This picturebox's image is data binded to a binary field in the database. When I set the image, it works fine: image is saved in the DB and everythings fine.
Now, when I want to CLEAR the image, I do the following:
this.picImage.Image.Dispose();
this.picImage.Image = null;
and...nothing happens. The next time I open the form, the image is still there. The binding is correct because if I change the bitmap, it is saved properly. It seems to be ignoring the null value Im trying to persist in the database.
I'm using Visual Studio 2005 and SQL Server 2005.
Help! Thanks in advance
|
|
|
|
|
How can i disable ALT+CTRL+DEL key of windows ?. Any links. Help me please
Jijo
-- modified at 9:02 Friday 17th February, 2006
|
|
|
|
|
|
Ok, you need a screwdriver, or a knife, or some other thin flat implement
put the thin end under the Alt key on your keyboard, and gently apply leaverage. The key should easily pop out. Repeat with the other alt key
Now do the same with both Ctrl keys
Finally repeat the process with the Del key (and also the other Del key on the numeric keypad, if the keyboard in question has one).
Include these instructions in the manual for your software, so that the end users can perform the same action.
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
Yeah, of all the ways to do it, sure, ASP.NET would offer the easiest approach!
Regards,
Nish
|
|
|
|
|
I would write a ASP.NET keyboard driver. That way, you will be able to handle any keystroke sequence.
--------
"I say no to drugs, but they don't listen."
- Marilyn Manson
|
|
|
|
|
I am with benjymous, I think a screwdriver would definetly be involved in an elegant solution,of course a quick and nasty solution would involve a hammer and/or explosives.
Regards
Ray
"Je Suis Mort De Rire"
Blogging @ Keratoconus Watch
|
|
|
|
|
jijobaby wrote: How can i disable ALT+CTRL+DEL key of windows ?.
There are several hardware solutions for this:
1. Remove the keys from the keyboard.
2. If your keyboard is switch-based, remove those small switches. This way you can keep the keys on the keyboard.
3. Buy a custom-made keyboard without those keys.
4. Put a dongle on the keyboard connector. This has the advantage of keeping those keys working normally, but block that specific combination.
AFAIK, there's no software solution for this...
From the Churchdown Parish Magazine: "Would the Congregation please note that the bowl at the back of the Church, labelled 'For The Sick,' is for monetary donations only."
|
|
|
|
|
Daniel Turini wrote: AFAIK, there's no software solution for this...
He could use a Mac
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
C# isn't powerful enough. You need a proper language like Befunge 93[^].
The following listing should give you a start
<br />
0>:48*- #v_$>0145*p0>:045*p:48*1--#v_$7>44*>?< _$++++\1-:#^_v >>^ ><br />
^+1p*73\0:< ^+1 _v#`2g*73:<>:2/ :v >0\2/:^ v< ^"TWANG.."<<br />
145*g1+:145*p8 8*` #v_ $> > 44*>?< _$++++:37*g2`!#v_ > <br />
>7*p:37*g37*+p^vg*540+1g$#*73g<^$< <>0\2/:^v _v#!`g*540: < # >"rra ehT."^ <br />
^3\+1g*73::p*73< >+2*+p# 045*^ ^ < <>:045*g64*1-g-#v_^ >:#,_$$ ^<br />
C."*520<p*5400< ^56g*73:g*540:_^#-g*46g*540:_^# -g*2+56g*540:<# v"re A,B,<br />
A("25*""v>5*p ^v1$< >025*".niaga gniyrT .sevac gnikam pu dewercS"^>"iF :)CB<br />
A,B,C."<^ 41 < _^#:p*7303p*37\5p*37\5p*37\5p*37\4p*37\4p*37\4$<v2"(abc): Move<br />
*73g+2* 73:\g*73g+1*73:,*52.+1:g*540$_,#! #:<"Cave "0<$_,#! #:<*5<v30g*73g*46\g<br />
540_v#- g-1*46<v"bats."*25_v#g*5440p*54:p*54:p*54:p*5450p*5440p*54< v 4g*<br />
vv< > :045*g^>" raeh uoY">545*g!#v_25*".tfard "v>v #"Tunnels lead to:">#<6*g-<br />
20_v$_^#!-g+1*73g*540:g*541$_,#! #:<"You feel a" <,:>$":A",,045*g:65+2*g1v^,:*5<br />
1>>025*"!supmuw a l" v> `#v_v v_\$37*1++v^_^#v-1*46:,,"B:",*52.+< <br />
2v^ $_,#! #:<"You smel"<2v` 2:-"A"$< <!vg\g*540< >g1+.":C"25*,,,64*g1+.">"<br />
v>5*,,> ~:25*-!#v_:"a"-:^>#v_:01 vv0:<>`^>:045*p37*g: 4- #v_$025*"!tab tnaig a"<br />
<>_#"#^^# $<"0$ _v#!`-<> 1-^v$_,#! #:<"Yo" "u've been snatched by "<br />
"ni llef uoY...eeeeeeEEEEEE" "Y">:#,_$@0 >:2/: v> ^ <>5-#v_025*"!tip a ot"<br />
\37*g5-#v_ $> $$> $$>$ > >44*>?< _$++++: : 045*g\:145*g\:37*g<br />
" net"v">4-!#^_-!#^_-!#^_\0+# 45 *p#^ #1 #<v>0\2/:^#v541g *5\0< >"!supmuw a yb"<br />
:#,_$@>"ae neeb ev'uoY...PLUG" ^ >:#,_$^> > ^>*g-#^_025*>?>v>"llik uoY"><br />
>37*1++v^"You bumped the wumpus." ^#<^"ed the w"<<br />
v40<^"The crafty wumpus dodged your arrow" < "<br />
5>0\25*\#v_ #^ #<"!">?<u<br />
*^-g*5<="">".gnihtyna tih t'ndid wo"vv_$^v"s"< "<br />
>g\g14^>_v#" >:2/ :v "0< v<,: >"upm"^<br />
Ryan
O fools, awake! The rites you sacred hold
Are but a cheat contrived by men of old,
Who lusted after wealth and gained their lust
And died in baseness—and their law is dust.
al-Ma'arri (973-1057)
|
|
|
|
|
You could also put this in your licence agreement:
Pressing ctrl+alt+del while using this software you are agreeing that a ninja comes to your home and chops off your head.
Or you could send information to the server when the user preses ctrl+alt+del and then instruct the ninja to do his work. That way you don't have to ship a ninja with every copy of the software.
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Anybody tried glue? No i don't mean to sniff it.... all you overdosers have a dirty mind!
|
|
|
|
|
What all these jokers are trying to say is what you want to do is just not possible in Windows...
We now return you to your regularly scheduled sarcasm.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
It's probably not obvious that this thread was originally posted in the lounge, and got moved here (somewhat unnervingly!) - that's why it got the sarcastic replies
--
Help me! I'm turning into a grapefruit!
Buzzwords!
|
|
|
|
|
You're right! I had no idea it was in the Lounge before comming here..
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello everyone, Im trying to get my program to wait with other tasks while it completes a task. Thread.Sleep(); did not work, instead the whole program "slept". Ive looked for threading example on the net and have found only complicated one dealing with servers and things but I just need the simplest example anyone can spit out. Ive tried also putting the tasks seperately and then defining threads for them, then when the user presses the button it is supposed to executes all the threads in the right order, I also set the priority for each thread. so far no luck and it seems like whenever I use Thread.Sleep(), thats one of the first things the app does while it should be one of the last. Im not sure exactly what to do at this point.
|
|
|
|
|
When you spawn multiple threads, you do so for concurrent computation. You should not spawn nine threads and then try to have them execute sequentially; this defeats the purpose of threads.
Why don't you spawn one thread with a callback method, have it do its work, then it will call your specified method and you can continue with what needs to get done?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
Well at the moment the project has 2-3 main objectives. One is to automatically fill out information in an application, ie. name, address, phone number, etc., then save the information. after saving the info it should close the application window. Since this window isnt apart of my project Im using API and SendKeys, but the problem is that my project closes the application window BEFORE the information gets filled out. If I dont try to close the window automatically, then the info gets filled out fine, so it seems that the API and SendKeys is either a bit "slow" or my project is just executing the command to close the window first. I dont think its as complicated as with 9 threads, but Ill see if I can find out about a callback method. This is my first time using threads.
|
|
|
|
|
Hi I wrote a SOAP-Client in C#.
To Execute SOAP-Requests is very easy by adding the web reference of the service.
But how can I access the SOAP-Messages e.G when I want to change the header or handle the attachment of SOAP-Responsemessages.
Florian
|
|
|
|
|