|
|
BWAHAHAHA
|
|
|
|
|
prachi14 wrote: I want to create a application like a photoshop in .net so please help me
Since I'm currently developing a new OS , like Windows XP in .NET , I have no spare time to help you.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Surely this should have been posted on 1st April.
If you don't know where to start I suspect you have absolutely no chance of success.
Bob
Ashfield Consultants Ltd
|
|
|
|
|
|
Hey
I have created a metode to create RadiobuttonList dynamically but when i show it in my page end i chec them to false or true and when i click the button all radiobutton is coming back to true.
I have a function to read wgat user have selected :
Hope i can help. her is som code to create radiobuttonlist:
foreach (DataRow dr in ds.Tables[0].Rows)
{
Label li = new Label();
System.Web.UI.WebControls.ListItem ls = new System.Web.UI.WebControls.ListItem();
RadioButtonList rl = new RadioButtonList();
rl.Items.Add(new System.Web.UI.WebControls.ListItem("Inkl", dr["Type"].ToString()));
rl.Items.Add(new System.Web.UI.WebControls.ListItem("Eks", dr["Type"].ToString()));
rl.RepeatDirection = RepeatDirection.Horizontal;
Panel2.Controls.Add(li);
Panel2.Controls.Add(rl); //tilføjer dem til panelet
}
then when i click a button hwo called checkthevalue, i called this metode:
foreach (Control cr in Panel2.Controls)
{
if (cr is RadioButtonList)
{
RadioButtonList rb = (RadioButtonList)cr;
foreach (System.Web.UI.WebControls.ListItem ls in rb.Items)
{
if (ls.Selected && rb.SelectedItem.Text == "Eks")
{
//this ad a line to pdf file
document.Add(new Paragraph("-" + rb.SelectedItem.Value.ToString(), FontFactory.GetFont(FontFactory.TIMES_ROMAN, 12)));
}
}
}
}
Hope i can help me.
|
|
|
|
|
I am designing a custom component (Non visible componenent). I inherited my class from System.ComponentModel.Component class. I know Component implements IDisposable . But how could I release resources used by my control ? Component class doesn't allow overriding Dispose . So how to dispose the objects used in my custom control ? Do I need to implement IComponent directly in my custom control ?
|
|
|
|
|
Declare the Dispose in your derived class with the new qualifier.
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
carbon_golem wrote: Declare the Dispose in your derived class with the new qualifier.
Thanks for the reply. But it won't work when ((IDisposable)componentInstance).Dispose() called as it's not a IDisposable member. And I think it's not a good practice to use new keyword which hides the base method.
|
|
|
|
|
Ok, Implement IDisposable on your derived class and forward the call to the base class's Dispose method. As for using the new modifier, FxCop doesn't complain about it.
Scott
"Run for your life from any man who tells you that money is evil. That sentence is the leper's bell of an approaching looter." --Ayn Rand
|
|
|
|
|
Thanks, I will give a try
carbon_golem wrote: FxCop doesn't complain about it.
FxCop ? I am pretty new to that. Let me try using that. Thanks again
|
|
|
|
|
Component offers a void Disposing(bool) virtual function. Override that.
See also Implementing a Dispose method[^] in the .NET documentation.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Thanks Mike. I found that
|
|
|
|
|
Hi,
Im trying to get the postdata string in beforenavigate2 event.
The function i:
<br />
void OnBeforeNavigate2(object pDisp, ref object URL, ref object Flags, ref object TargetFrameName, ref object PostData, ref object Headers, ref bool Cancel) {<br />
byte[] myBytes = System.Text.Encoding.ASCII.GetString(PostData);<br />
MessageBox.Show(myBytes.ToString());<br />
<br />
<br />
}<br />
As you can see, im trying several methods to convert the postdata to a string, but im not able to...
MessageBox.Show(PostData.ToString()); shows "System.bytes[]".
I've found this :
http://support.microsoft.com/kb/256195
but the examples are on Visual Basic and C++, and im not able to convert that code to c#
Can anybody help plz?
|
|
|
|
|
byte[] myBytes = (byte[])PostData;
string post = ASCIIEncoding.ASCII.GetString(myBytes);
MessageBox.Show(post);
That was the solution!!!
|
|
|
|
|
hi,
all hcan some one guide me how to print file(excel sheets) using .net application urgent pls!!!
|
|
|
|
|
sailesh_gupta wrote: application urgent pls!!!
Of COURSE it is....
sailesh_gupta wrote: sailesh_gupta
Are you related to Sonia ? She doesn't know how to use google either.
I recommend reading the article I link to below.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi,
I'm currently studying how C# can be used to control MSN messenger. I'm searching here in CodeProject and google. There are couple of examples and none of them work properly for me. I know, I may not be using them properly.
They talk about MessengerAPI. I added reference Add reference -> COM -> Messenger APIs. But, I stillget error as
The type or namespace name 'MessengerPriv' could not be found (are you missing a using directive or an assembly reference?) H:\New Folder\msn\msnsessionchange\MessengerUnlocker.cs.
Please tell me what is the proper way to work on MSN messenger with C# and how to add the proper refrence to MessengerAPI. I also saw MSDN article on Messnger Lock and key API.. All said and done, it doesn't look straight forward to me.
Any help would be appreciated
Thanks
Vikas
|
|
|
|
|
I have a c# dll that is used in c# apps.
How should i handle exceptions in the dll so that it lets the app that is using it know there was a problem and it can report it?
1. Let the exception bubble up
2. Rethrow the exception
3. Have a custom exception, and throw that with the original exception as the inner exception
4. Any other suggestions
The dll does file io, db work and uses collections, so there are a few places that exceptions could occur.
TIA
|
|
|
|
|
|
I will go and have a read, thanks
|
|
|
|
|
If the exception would be useful for the calling code, you can just let it bubble up. If you for example have a method that reads a file, any IO exceptions would make sense to the calling code, as it's directly related to what the method does.
If the exception is not really useful for the calling code, you should just throw a custom exception instead. Whether to include the original exception as an inner exception depends on how useful that information is. If your method for example is parsing values from the text file into integers, and there is a parsing error, you should throw an exception that specifies what the method was expecting to find at that location in the file.
When catching exceptions, you can specify a base class for the exceptions that you want to catch, and let other exceptions bubble up.
Example:
try {
i = int.Parse(stream.ReadLine());
} catch (FormatException ex) {
...
} catch (OverflowException ex) {
...
}
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Is there any kind of serializer in .net that can be used to load and save object graphs w/o barfing if unexpected/old elements exist in the serialized data?
I simply want to ignore field/property names that no longer exist in the serialized classes.
such field should simply be set to their default values.
XmlSerializer won't cut it since it only handles hierarchies and real graphs.
SoapFormatter seems like it always crash if unexpected elements are found.
I do know I can implement ISerializable but Im trying to avoid that, I want it to be easy to plug in new elements in the save file in this use case.
I'm hoping there might be some nifty stuff in WCF for this, or that it might be possible to handle this with the soapformatter.
any ideas?
|
|
|
|
|
I assume you are using the BinaryFormatter.
Wont ISurrogateSelector help?
|
|
|
|
|