|
Hi
i wanna draw circle in a form and setting a picture in that , then moving that in form on a + (Plus) path . in fact the circle (with 100 pixel radius will move from center of form to each side of form
|
|
|
|
|
Create a class that derives from Control. Override the OnPaint and OnPaintBackground methods. Use the graphics context to do the drawing.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
A table contains a,b,c columns
a contains data.
b and c Contains NULL Values.
I fill dataset(ds) with the values of a,b,c
if(ds.Tables[0].Rows[0]["b"].ToString()==Null )
textbox1.text="asd";
this condition is not satisfied,when comparing with value NULL ,they failed to compare and skip that condition.
What other syntax I can use to solve that problem.
|
|
|
|
|
if(ds.Tables[0].Rows[0]["b"] == System.DBNull.Value)
|
|
|
|
|
|
My print preview code looks like this:
PrintPreviewDialog dlg = new PrintPreviewDialog();
dlg.Owner = Application.OpenForms[0];
printDocument.DocumentName = file;
printDocument.PrinterSettings.DefaultPageSettings.Landscape = true;
dlg.Document = printDocument;
dlg.ShowDialog();
The setting is never turned off from landscape, and yet, the printing is landscape, and the print preview isn't. I've done some googling, but I can't see any further info on this, or any reason why it's not working ?
Christian Graus - Microsoft MVP - C++
"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 Christian,
Couple of years ago I struggled a lot with printer settings (landscape, color, duplex),
I never understood the model, it seems complex and not logical; but I got it to work
eventually.
I use printDocument.DefaultPageSettings.Landscape=landScapeFlag;
and that seems to do it for me.
Hope this works for you too.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Awesome - there's two lots of page settings in the class, I guess one is the default for printing, and one is the default for preview ( but it's just on the root ).
That worked by the way, you're a champ, thanks.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I have create 20 different objects and offcouse they each of them peforms different task. But how can i determine which objects holds more memory out of 20 objects. Is there a way to figure it out so i can manage my objects efficiently.
Thanks
|
|
|
|
|
Odds are high that you're worrying about nothing. What unmanaged resources do these objects contain ? If none, you probably don't need to care, unless you're going to create millions of them.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
You're in a managed world for memory allocation, so it doesn't really make sense for you to worry about this so much. Just remember to instantiate an object just before it's about to be used and be sure to call Dispose() if the object is IDisposable. Let the GC do it's job and you should be fine.
But if you absolutely have to see this information, you should take a look at Son of Strike debugger. This should allow you to see your objects in memory and get their size. Again, this is not a run-time solution and I doubt you'll ever see a run-time API (at least from MS).
Here's an article on SOS debugger -> http://www.csharphelp.com/archives4/archive622.html[^]
|
|
|
|
|
Count the number of members in your objects and guestimate the size of them. I say guess because I believe in .NET a Int32 does not take up 32 bits but slightly more. Also, count one word for each memory reference.
Also, if you use recursion you will have to guess the call stack as that is memory usage as well.
Need a C# Consultant? I'm available.
Happiness in intelligent people is the rarest thing I know. -- Ernest Hemingway
|
|
|
|
|
Hi guys. I need to put a web browser into an application. I don't care what language I do it in, but I want to get events when a DOM event fires ( such as a mouseover or a click on a link ), and I want to get an event that tells me they are about to fire, which allows me to cancel the event. Is this even possible ?
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Navigating will tell you when it tries to go somewhere, but I'm not sure how to capture every DOM event. Maybe if you told us what you want to prevent there is another way?
|
|
|
|
|
Basically, I want to be able to know when an event occurs on the DOM, so my code can do something in response, or cancel the event. There's really no other way to do it.
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
Here's a list of the Events for the .NET 3.5 WebBrowser Class. http://msdn2.microsoft.com/en-us/library/system.windows.forms.webbrowser_events.aspx[^]
It appears that a lot of those events that miht be useful to you are marked as infrastructure and not supported by the control, but it appears that you can just inherit from WebBrowserBase and hook into those events from there.
Sorry I can't giveyou a definite answer as I've barely used the WebBrowser Class. Good Luck.
|
|
|
|
|
thanks
Christian Graus - Microsoft MVP - C++
"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 )
|
|
|
|
|
I have to develop a web application from a web site.
On the web site, on the App_WebReferences folder, there is a folder
ContactComponent and there are 3 wsdl files, First,Second and Third inside that.
On the web site, the web service is referenced as ContactComponent.First,
ContactComponent.Second and ContactComponent.Third
On my web application also, I need to reference the same way.
How will I add all the three web services to one reference so that I can call ContactComponent.First
ContactComponent.Second
ContactComponent.Third
Thanks
|
|
|
|
|
graphicsPath.AddString("sample", fontfamily, ..., ..., ...);
graphic.DrawPath(pn, graphicsPath);
I have added "sample" to addstring method while application is loading. As i proceed i require to change the name from "sample" to "Item". Can i change it? If yes, how?
|
|
|
|
|
Even i used string variable but in vain..
|
|
|
|
|
I assume you are doing your drawing from either a somecontrol_Paint or OnPaint overriden method that gets drawn whenever the control gets invalidated. Therefore you can issue an control.Invalidate() and use replace the string with whatever.
off the top of my head
private void control_Paint(object sender, PaintEventArgs e)
{
string str = "sample";
if (!loading)
str = "Item";
graphicsPath.AddString(str, fontfamily, ..., ..., ...);
graphic.DrawPath(pn, graphicsPath);
graphicsPath.Dispose();
pn.Dispose();
}
then somewhere, relevent, in you code issue;
isLoading = false;
control.Invalidate();
Hope this helps,
Mike
|
|
|
|
|
I am writting a progam to demo CSMA/CD in the Ethernet, but I don't know how to do. Who can give me code for CSMA/CD? Thanks you very much. Help me!
|
|
|
|
|
If You have code for it could you send it to my mail thucbv@gmail.com
Thanks a lots.
|
|
|
|
|
Ok, Thanks.
This is a protocol used in the Internet. CSMA/CD stands for Carrier Sense Mutil Access / Conllision Detect.
|
|
|
|
|
What prevented you to edit the first discussion thread and present a consolidated query instead of giving separate reply-to-yourself style threads?
Also, discussion forums can not be expected to supplant the basic ground work and homework. They only can streamline your basic work, enhancing the output and helping out in your troubleshooting efforts.
I would suggest you give a deep study of Forum Posting Guidelines here: http://www.codeproject.com/scrapbook/forumguidelines.asp[^]
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|