|
Override the OnPaint function
|
|
|
|
|
Reposting your question 3 hours apart in the same forum is consedered very rude!!! Don't do that again, and review my answer to your previous post
|
|
|
|
|
It's happening a lot at the moment. I assume it means 'I don't understand the answer, and am hoping for one I can copy and paste'
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
i have when i click on the button i want to open new form
i know how to open new form (new Form();)
1- but how can just open just one form at the same time (one instance)
2- i want the user cant focus on the old form without close current form
Palestine
|
|
|
|
|
Form.ShowDialog
only two letters away from being an asset
|
|
|
|
|
1- How do you do to open more than one form at a time? Just don't do it that way.
2- Use the ShowDialog method to show the form.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
I am searching for a good WYSIWYG Html control for last 6 months in Google, I did not get a good one. Do anyone know a good Win form .NEt 2.0 Control for Html Editing.
Thanks
|
|
|
|
|
There are *tons*. You can even host the IE control and use its inbuilt editor if you want.
Maybe if you told us what you don't like about the currently available ones we could narrow it down.
|
|
|
|
|
Hello,
I did not find any good one even commercial. Which already has a toolbar and good API. I did not find any way to use IE control as an editor. would you please show me in little more details.
Thanks
Regards
|
|
|
|
|
I've read an article about fast pixel processing[^] posted in codeproject.
As we all know, the GetPixel() and SetPixel() functions have a lot of overhead.
So... The most common solution I've found so far was to lock the pixels in memory and perform calculations using unsafe code and pointers.
If you look at the source code provided with the article mentioned above, you'll see that AndrewVos ,the writer, does lock the pixels in memory, but instead of looping through pixels using unsafe pointers, he marshals them into an array.
I'm sure that the safe and managed code is better.
After all it IS "safe and managed".
But is it slower/faster than unsafe code?
Thanks in advance,
Shy.
|
|
|
|
|
shyagam wrote: But is it slower/faster than unsafe code?
If you are going to manipulate a large amount of pixels, the marshal overhead will be small. For justa few pixels, unsafe will still be the fastest.
|
|
|
|
|
i want to make event after my Form finsh loading all component .....
at any event can put it ?
Palestine
|
|
|
|
|
Hello
You should put your code in the Form.Shown event. Yet, notice that it needs .Net version 2.0
If you don't have version 2.0 you may try the Activated event, yet it will be fired evry time you code is activate it. So if you want to run it once, make a bool and set it to false after the first time.
Regards
|
|
|
|
|
Iam trying to paint a button to get a shade in a button. How do i do it.
Iam using this code below. Iam using a LinearGradientBrush but it doesn't
seem to do anything
void button1_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Rectangle rcView = this.ClientRectangle;
using (LinearGradientBrush brush = new LinearGradientBrush(rcView, this.ColorStart, this.ColorEnd, this.GradientMode))
{
g.FillRectangle(brush, rcView);
}
base.OnPaint(e);
}
ColorStart and ColorEnd are basically colors. Iam just get the shade of the
color from lighter to darker across the button. So my ColorStart is a
little lighter color and ColorEnd is a Darker color.
Thanks
Kal
|
|
|
|
|
Hello
Few points:
1- this.ClientRectangle => Should be => button1.ClientRectangle
2- base.OnPaint(e); => Why this??
3- How do you define: this.ColorStart, this.ColorEnd, this.GradientMode?? Which colors exactly did you use? Very close gradients may fuse together.
Now try this code:
Graphics g = e.Graphics;
Rectangle rcView = button1.ClientRectangle;
using (LinearGradientBrush brush = new LinearGradientBrush(rcView,Color.DarkGreen, Color.DarkMagenta, 50 ))
{
g.FillRectangle(brush, rcView);
}
|
|
|
|
|
Thanks for answering me.
I got it to work.
You are right its button1.ClientRectangle.
I had to again use g.DrawString to draw the name on the button because its
lost after i painted
Thanks
Kal
|
|
|
|
|
Hello, everybody! I've just realised that in a few days (on the 15th September) i have to present a project as an examination for certification in Informatics (still in college, but...). The only thing i lack is an idea. I thought of building an IM client, still, i have no idea how to send the messages from one computer to another (IP adresses, maybe?), so, i'll need a new idea. I know this isn't the best place to ask this question, but, C# is rather the only programming language i know.
--> about the IM client:
i know it must contain a background process that waits for writing from the other computer, a beggining and ending signal of the message, a user interface and... the most important thing (probably because i don't know it): a way to transmit the messages without using a server (because i don't have one and have never worked with one)
<--
please, help me out!
|
|
|
|
|
Here are details of source code available from http://www.miranda-im.org/download/[^]for the Miranda IM version 0.5 Open Source Project. Unfortunately it is not written in C# but if you download the source code, I am sure that you will be able to think your way through. This open source project was found here [^] and other IM's and other open source projects are housed here.
HOWEVER, don't you think you have left this college project a little late.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Don't encourage them
only two letters away from being an asset
|
|
|
|
|
I know. Just trying to help.
Crazy ain't it that college students just don't know how to organise themselves in terms of time-management. Who in their right mind leaves it until the last minute to start a project that by now should have been completed.
modified 1-Aug-19 21:02pm.
|
|
|
|
|
Well, the fact is i have another project done for that exam. The thing is that i am not very sure of it's success (it's a simple idea, exploited to the maximum) and that's why i am trying something new that will sure beat the rivals and get the judges' attention. Anyway, thanks a lot! I appreciate u'r work and support.
|
|
|
|
|
drc_no1 wrote: i am trying something new that will sure beat the rivals and get the judges' attention.
Then don't do a chat program. Everyone has done that and there are so many examples out there it certainly won't highlight your thoughts and your work. If it were my class you'd get no higher than a C and that would be only if I didn't see your post on Code Project
only two letters away from being an asset
|
|
|
|
|
Hi,
Do you know any open-source/free implementation/library for circular layout algortihm similar to
this?
Any ideas/links to any information on the topic would be usefull.
Thanks.
Vitaliy Tsvayer
Tikle
|
|
|
|
|
|
Hey all,
I know that if I have, for example, the following expression:
if (x < 5 && y < 5)
In case x is NOT lower than 5, the next condition is not even evaluated.
But what about "or" statements?
If I have this:
if (x < 5 || y < 5)
In case x IS lower than 5, is the next condition evaluated?
Thanks in advance,
Shy.
|
|
|
|