|
But I see only one event here. Write two events for both radio buttons, and assign the textbox value in those events. No need of using the flag
|
|
|
|
|
Awesome now i got it working........now its working fine.....thankyou guys
C#
|
|
|
|
|
hi,
i have one more doubt
if i want to use multiple windows that form1 will have datagrid and form2 will have textboxes and if i want to display the details entered in form2 in the datagrid in form1 .....do i need to use delegates or is there any other easy way of doing it.....
thanks
C#
|
|
|
|
|
kabutar wrote: do i need to use delegates or is there any other easy way of doing it.....
Delegates are always a good practice. Alternatively you can overload form2 constructor and pass form1 object there while invoking form2. Use this object to set value back to form1.
|
|
|
|
|
Thanks again will try with delegate first
C#
|
|
|
|
|
if you have two radio buttons then btnRadio_Click(object sender, EventArgs e) corresponds to which radio button is it for both ?
Koushik
|
|
|
|
|
I have source code from Christian Graus (Image Processing for Dummies with C# and GDI+ Part 2 - Convolution Filters), but i don't understand with emboss concept , i mean...why in emboss filter use offet value 127?If have some emboss concept, please send for my email stevi_uul@yahoo.com
Thanks before....
Haloha...!!!!
|
|
|
|
|
You're welcome to try other values and see what happens. Why does the value disturb you ? The code I present represents the most common approach to embossing you're likely to find. The only issue I see with it is that a convolution filter limits what angles you can emboss at. I've started a filter that allowed embossing at any angle, but never finished it.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Not to second guess Christian because he's the man here, but why aren't you asking this question on the article forum? Plus - don't put your email in the message. If you leave the Notify me by e-mail checkbox selected, you'll get replies sent to you.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hi all
I have a problem. Am tring to display data on dropdown list, i have two dropdown list. i'm displaying data on both from database. when the application starts running the first ddl will list out some data. when we select one the second ddl will display data according to that. but here the problem is, when i select one on first ddl, it is automaticaly errasing all the datas.....
i havint given any where clear command. y it ts not displaying. the problem i nly when it is connected to database. i tried a sample, it is working.
plz help me....
|
|
|
|
|
Is this an ASP.NET app ? Are you binding to your datasource on postback ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
no
i have written the code inside if (!IsPostBack)
|
|
|
|
|
And have you stepped through the code in the debugger to see at what point it loses it's values ? Is viewstate turned off ? If that's the case, then you will lose your values, as you've described.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
no...
viewstate is on only
i tried to debug the cod
the control is not going to
private void DdlCustomer_SelectedIndexChanged(object sender, System.EventArgs e)
y is it so....
|
|
|
|
|
Well, at the level you're talking, you're really better off buying a book and working through it until you've got some core stuff down. But, msdn.microsoft.com is the MS documentation, and there's lots of articles on this site.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
|
Most of the classes in ADO.NET includes a Dispose() method. I know it is called to release unmanaged objects. But when it is called, immediately the objects will be removed or it will remove only the references, and objects will be removed on the next collection cycle ?
|
|
|
|
|
The unmanaged objects are released right away, that's how Dispose always works.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Christian Graus wrote: The unmanaged objects are released right away, that's how Dispose always works.
Thanks Christian. But what is the difference between removing reference and removing object ? If reference got removed, how it can identify which was the object in the memory ? So I felt GC will remove both reference and it's object. Right ?
|
|
|
|
|
Dispose cleans up unmanaged resources. It exists apart from GC and from the collection of the object that held the unmanaged resource. The GC will remove the object, as all references have expired. At this point, Finalise is called, which should clean up the same stuff Dispose does, you call Dispose to have stuff cleared without waiting for GC.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillionOneHundredAndFortySevenMillionFourHundredAndEightyThreeThousandSixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it )
|
|
|
|
|
Christian Graus wrote: The GC will remove the object, as all references have expired.
Ok. So it won't clear the reference alone.?
Christian Graus wrote: At this point, Finalise is called, which should clean up the same stuff Dispose does, you call Dispose to have stuff cleared without waiting for GC.
Ok, So you are telling that even if Dispose() is not called explicitly, GC will call it and dispose the unmanaged code. But AFAIK, GC won't consider the unmanaged resources. That's what they provided Dispose() to call explicitly. What do you think ?
|
|
|
|
|
The standard implementation in objects with unmanaged references is to call Dispose from the destructor. If you forgot to call Dispose it will still be called from the garbage collector when it gets arround to release the object.
This does not mean you shouldn't call Dispose, just like the fact that your car has airbags doesn't mean you should crash it.
I recommend you Google C# dispose pattern[^] and read a bit about how it is implemented (including the use of a destructor).
|
|
|
|
|
lmoelleb wrote: If you forgot to call Dispose it will still be called from the garbage collector when it gets arround to release the object.
See the following from MSDN
MSDN says: Do not assume that Dispose will be called. Unmanaged resources owned by a type should also be released in a Finalize method in the event that Dispose is not called.
And the design pattern says, not to call Dispose() method from Finalize. What do you say ? This makes things in confusion.
|
|
|
|
|
Sorry I wasn't clear enough. With "it" I was referring to "whatever code cleans up the object", not specifically the Dispose method. I can see this was not clear the way I wrote it.
To avoid confusing statements I'll just include the standard dispose pattern here.
From memory, typing streight into the editor - syntax errors to be expected, but the pattern should be more or less correct.
<br />
class Whatever : IDisposable<br />
{<br />
~Whatever<br />
{<br />
Dispose(false); <br />
}<br />
<br />
public void Dispose()<br />
{<br />
Dispose(true);<br />
}<br />
<br />
private void Dispose(bool disposing)<br />
{<br />
if (disposing)<br />
{<br />
<br />
<br />
GC.SuppressFinalize(this)<br />
}<br />
}<br />
}<br />
|
|
|
|
|
Great. So assume I am not writing the Finalizer method for my class. I just wrote only Dispose(). So will GC call the Dispose() method ? What will happen to the object that uses unmanaged references if it is not cleared on Dispose()/Finalize ?
|
|
|
|