|
Sorry I forgot to send the DataReceived event (which is on the form side) here is;
private void cardReader_DataReceived(byte[] b)
{
this.Invoke(new CardDataReceivedEventHandler(cardReader_DataReceivedInvoke), b);
}
private void cardReader_DataReceivedInvoke(byte[] b)
{
try
{
if (b.Length != 0)
{
string s = cardReader.BtyeArrayToStr(b);
}
}
catch (Exception ex)
{
}
}
|
|
|
|
|
Thanks for all the code, it does not really help; what one needs to design, implement and debug the
whole thing is documentation and a device for experimentation/verification.
You once more did not apply PRE tags (use the "CODE BLOCK" button below the edit field), so I am not going to even look at it.
And I forgot to tell you it is a very bad idea to catch an exception and then hardly do anything with it;
when things go wrong, the exception tells you the details of a problem, so let it show all it is holding
as in Console.WriteLine(exc.ToString())
Have you found the ASCII ENQ character yet?
modified on Saturday, January 10, 2009 9:44 AM
|
|
|
|
|
Hello,
I have a default page on which there are three user controls put inside three panels within the page. Based on a click event of a button in any of the user control, i want to unload a user control in the page and load a diferent user control in its place. I am using VS 2008 and C# as the code behind... Your inputs would be very helpful....Thanks in advance
|
|
|
|
|
I believe this is a ASP.Net Question , So please post it on asp.net forum.
cheers,
Abhijit
CodeProject.Com MVP
|
|
|
|
|
You can do it using delegates.
Create a delegate in the usercontrol with some return type / parameters with which you can set the visibility of the usercontrol, add an event for this delegate.
Add a button with a button click event in user ctrl.
Call the event in the webpage which in turn should call the user control's button click event.
Try this out.
Cheers,
Sudhanva
|
|
|
|
|
You could make the Set the Visible property on the controls to the appropriate value so they are not rendered to the client unless they need to be.
|
|
|
|
|
I would personally instantiate all of them with the Visible property set to false, and then show/hide them as necessary.
You can even initialize them when he VisibleChanged event is fired.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thank you for the response. But here i am having around 50-60 controls now and the number is again going to increase. Do you think its a good idea to load as many number of controls on the form and keep its visible property false? The requirement is something as that of how Microsoft Dynamics work. We have one default page with left and main content panels that holds the user-controls which keep changing as per the button clicked...
|
|
|
|
|
I want to create my own 'URL' in a RichTextBox. when a user types [[LinkName]], it should display as a link.
Example
The documents with name [[The road to C#]] and [[An introduction to C#]] are very interesting.
How can this be created in a C# RichTextBox and how can I add a ClickEvent.
Thanks!
modified on Saturday, January 10, 2009 6:13 AM
|
|
|
|
|
You can do this by tweaking the registry, without lots of coding;
Hope this helps
I are troll
|
|
|
|
|
Thanks for this reply. It already helps me a bit.
Does anyone know if it is also possible to do whithin the application code (so without tweaking the registry)?
|
|
|
|
|
Hi!
Does this article[^] help?
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Looks very good. I will look into it.
Thanks!
|
|
|
|
|
Is there any way other than Abort to terminate a thread.
How can i Suspend or resume Asynchronous threads
|
|
|
|
|
thenewbee wrote: Is there any way other than Abort to terminate a thread
In normal situation the thread execution ends when the method you passed for ThreadStart has finished.
thenewbee wrote: How can i Suspend or resume Asynchronous threads
You can call Sleep inside the thread. If you need to synchronize separate threads, see for example Join method and lock statement
|
|
|
|
|
Hi,
IMO the best ever summary of all you ever wanted to know about threads is here.[^]
|
|
|
|
|
That was an excellent link! Immediately added it favourites
|
|
|
|
|
is there anyways to know the assembly name ? eg. i added a reference of another project, now i want to know that project assembly name...any way ?
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
If you know a type or have instantiated an object from the assembly you can get it's AssemblyQualifiedName , for example:
someObject.GetType().AssemblyQualifiedName
Is that what you were looking for?
|
|
|
|
|
yes but it dont have exactly what i want...i mean i have to parse that string to get the assembly name.
its format is like
Object's Full Name, Assembly Name, Version, Culture, PublicKeyToken
thanks
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
So do you need only the name? If so, if I remember correctly, you could use:
SomeObject.GetType().Assembly.ManifestModule.Name
|
|
|
|
|
hehe, we are just near
http://www.codeproject.com/script/Forums/View.aspx?fid=1649&msg=2873796[^]
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
sorry for double post but i got, its in
object.GetType().Assembly.GetName().Name
thanks you mate
TVMU^P[[IGIOQHG^JSH`A#@`RFJ\c^JPL>;"[,*/|+&WLEZGc`AFXc!L
%^]*IRXD#@GKCQ`R\^SF_WcHbORY87֦ʻ6ϣN8ȤBcRAV\Z^&SU~%CSWQ@#2
W_AD`EPABIKRDFVS)EVLQK)JKSQXUFYK[M`UKs*$GwU#(QDXBER@CBN%
Rs0~53%eYrd8mt^7Z6]iTF+(EWfJ9zaK-iTV.C\y<pjxsg-b$f4ia>
--------------------------------------------------------
128 bit encrypted signature, crack if you can
|
|
|
|
|
Exactly
You're welcome
Mika
|
|
|
|
|
hello,
i am using c#.net in vs 2008.
can anybody say me why the error occured while using System.Drawing.Printing?
I want to print Custom size paper in dot matrix pnrinter for billing purpose. But it print in a4 size paper. so i change my code to the following but this did not work.
Please help me.
The code i use are
PrintDialog pd = new PrintDialog();
PageSetupDialog psd = new PageSetupDialog();
PrintDocument pdoc = new PrintDocument();
PaperSize ps = new PaperSize();
psd.PageSettings = new PageSettings();
psd.PrinterSettings = new PrinterSettings();
bool flag = false;
foreach (PaperSize ps1 in psd.PrinterSettings.PaperSizes)
{
if (ps1.PaperName.Contains("Custom"))
{
ps = ps1;
flag = true;
}
}
if (flag)
{
ps.Height = 5;
ps.Width = 3;
psd.PageSettings.PaperSize = ps;
printDocument1.DefaultPageSettings = psd.PageSettings;
printDocument1.PrinterSettings = psd.PrinterSettings;
pd.Document = printDocument1;
if (pd.ShowDialog() == DialogResult.OK)
printDocument1.Print();
}
I wating for replu.
|
|
|
|