16,020,984 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by yummy02 (Top 66 by date)
yummy02
6-Feb-11 20:23pm
View
Yes, last time I forgot to vote. Sorry :)
yummy02
3-Feb-11 21:53pm
View
+5 :) Now I realized it's so true..
yummy02
3-Feb-11 21:46pm
View
Thanks :) But Some lines also disappear when I redraw new lines. How can I redraw specific lines and retain others that wasn't move yet by the user. I mean If I have to move specific picturebox, the line connected to this one follow, but the other lines not connected to it remains.
yummy02
1-Feb-11 6:49am
View
Thanks for editing/updating my questions. :)
yummy02
1-Feb-11 5:19am
View
Here my code in Paint Event:
void PaintThis(object sender, PaintEventArgs e)
{
newStruct ST = new newStruct();
xd.Load(filename);
XmlNodeList xnl = xd.SelectSingleNode("root").ChildNodes;
foreach (XmlNode xn in xnl)
{
XmlElement xe = (XmlElement)xn;
XmlNodeList name = xe.GetElementsByTagName("picname");
XmlNodeList x1 = xe.GetElementsByTagName("x1");
XmlNodeList y1 = xe.GetElementsByTagName("y1");
XmlNodeList xc = xe.GetElementsByTagName("xcenter");
XmlNodeList yc = xe.GetElementsByTagName("ycenter");
XmlNodeList x2 = xe.GetElementsByTagName("x2");
XmlNodeList y2 = xe.GetElementsByTagName("y2");
ST.graps = e.Graphics;
Pen myPen = new Pen(System.Drawing.Color.Blue, 3);
for (int j = 0; j < name.Count; j++)
{
ST.x1St = Convert.ToInt32(x1[j].InnerText);
ST.y1St = Convert.ToInt32(y1[j].InnerText);
ST.xcSt = Convert.ToInt32(xcenter[j].InnerText);
ST.ycSt = Convert.ToInt32(ycenter[j].InnerText);
ST.x2St = Convert.ToInt32(x2[j].InnerText);
ST.y2St = Convert.ToInt32(y2[j].InnerText);
ST.halfHeight = 50;
ST.halfWidth = 50;
//DRAW LINES IN PANEL THROUGH POINTS
ST.graps.DrawLine(myPen, ST.x1St + ST.halfWidth, ST.y1St + ST.halfHeight, ST.xcSt, ST.ycSt + ST.halfHeight);
ST.graps.DrawLine(myPen, ST.xcSt, ST.ycSt + ST.halfHeight, ST.xcSt, ST.x2St);
ST.graps.DrawLine(myPen, ST.xcSt, ST.x2St, ST.x2St, ST.y2St);
}
}
}
yummy02
27-Jan-11 20:36pm
View
I was unable to view my active x.
yummy02
27-Jan-11 19:54pm
View
+5.. Thanks, I'll try it now...
yummy02
27-Jan-11 19:54pm
View
+5.. Thanks, I'll try it now...
yummy02
27-Jan-11 19:54pm
View
+5.. Thanks, I'll try it now...
yummy02
26-Jan-11 4:12am
View
Hi.. Can I ask if where can I place the Paint event you posted? and Is that a correct format or there's missing. Because I tried to insert a code similar to what you had post. And I got some error regarding " => "...
yummy02
25-Jan-11 4:58am
View
+5 :)
yummy02
25-Jan-11 4:58am
View
+5 :)
yummy02
25-Jan-11 3:31am
View
Is there anyway that I can drawn a line that i clickable and movable?
yummy02
25-Jan-11 3:28am
View
i have 3 lines in the form and all of them are created using Graphics.DrawLine. How can I maintain a list where lines starts and ends? Thanks OriginalGriff... :)
yummy02
25-Jan-11 1:56am
View
Thanks SAKryukov... :)
yummy02
24-Jan-11 3:49am
View
I have a question, moving two different controls in a panel inside user control is possible. But let's say there's a 3 instances of picturebox and 3 corresponding instances of label below picturebox. Can I move picturebox and label below it simulataneously? I mean each pbox has a label partner. Can I move a pbox together with its partner without clicking label?
yummy02
24-Jan-11 2:04am
View
Thanks but how can I make a control as children into other control?
yummy02
20-Jan-11 23:14pm
View
but how can i do that? i my mouse event, there are only codes available in moving picturebox, not lines..
yummy02
18-Jan-11 1:48am
View
Thanks for that JOAT-MON. I will try that.
yummy02
18-Jan-11 1:47am
View
Thanks for that RaviRanjankr. I would like to know if I have an instances of textbox in my form. And in all instances of textbox, label is also included. So the problem is when I move the textbox in different location. I would like the label to move too. Is that possible for instances of picturebox?
yummy02
17-Jan-11 21:30pm
View
What if I would like to have a movable textbox that when I will move it, the label over textbox will follow... Is that possible?
yummy02
15-Jan-11 2:49am
View
I have a follow-up question. I have a paint event that draw lines. Is it possible to have a movable lines? If so please guide me. Thanks. :)
yummy02
15-Jan-11 2:47am
View
Thanks.. :)
yummy02
15-Jan-11 2:47am
View
Thanks.. :)
yummy02
15-Jan-11 2:47am
View
Thanks.. :)
yummy02
10-Jan-11 22:12pm
View
wow! the link you provided is a great example...
yummy02
10-Jan-11 21:00pm
View
Thanks Abhinav.. :)
yummy02
6-Jan-11 0:32am
View
I haven't tried WPF. I will search for it first.
yummy02
6-Jan-11 0:31am
View
@SAKryukov: Thanks for this one. I have a lot about using Invalidate. But actually, to be honest with you, I did not understand the last code that you'd posted. It's something to do with "panel1.Paint += (sender, eventArgs) => {". I didn't understand that maybe because I haven't use it in anyways. Where should I put that code? Thanks for the help. I appreciated it a lot even though sometimes, you ruin my day with our comments. :)
yummy02
6-Jan-11 0:26am
View
@Dave: thanks for that suggestion. :)
yummy02
6-Jan-11 0:25am
View
One thing, I asked questions several times, not to fool anyone, but to further gain knowledge to those who knows and shares knowledge. :)
yummy02
6-Jan-11 0:21am
View
@SAKryukov: Actually you're right, lines are used as the connections to the pictureboxes. I was also thinking of doing it at WPF but lack of time to do so.
yummy02
5-Jan-11 5:06am
View
Hi,
What I'm trying to ask is that I want to draw lines that will connect two or more picture boxes. I can't draw lines. I just can draw one line even though I have 5 picture boxes. All picture boxes are loaded by means reading a file. It means to say that if the file has 5 picture boxes, the app will load all 5 make lines that will connect each picture box. I don't know if that's possible.he he Thanks. :)
yummy02
5-Jan-11 1:22am
View
I want to add lines outside picturebox. Since the occurrence of my picture boxes is per instance, I want to draw lines in all instances of pictureboxes. I think, lines can be make through instances too.
yummy02
3-Jan-11 3:26am
View
By the way, right now, it does not create several lines but the lines (when I move the mouse downward) dislocate, or may I say the line changes from the line that I assumed to the line that I did not expect.
yummy02
3-Jan-11 2:28am
View
Hi,
There's a problem, I wasn't able to view the designer of my form. I can only view the codes. But viewing the codes and the form may be useless because I did not store any codes in my form, only in my user control.
yummy02
2-Jan-11 22:43pm
View
that's it: I hope that info could help. Thanks jerrykid!
namespace ClassLibrary1
{
public partial class UserControl1 : UserControl
{
PictureBox pbox1 = new PictureBox();
public UserControl1()
{
InitializeComponent();
}
private void UserControl1_Load(object sender, EventArgs e)
{
XmlDocument xd = new XmlDocument();
xd.Load(@"\XML.xml");
XmlNodeList xnl = xd.SelectSingleNode("root").ChildNodes;
foreach (XmlNode xN in xnl) //for each node in xml file
{
XmlElement xElem = (XmlElement)xN;
XmlNodeList c = xElem.GetElementsByTagName("c");
XmlNodeList x = xElem.GetElementsByTagName("x");
XmlNodeList y = xElem.GetElementsByTagName("y");
XmlNodeList loc = xElem.GetElementsByTagName("loc");
for (int a = 0; a < c.Count; a++)
{
int x1 = Convert.ToInt32(x[a].InnerText);
int y1 = Convert.ToInt32(y[a].InnerText);
pbox1 = new PictureBox();
pbox1.Location = new Point(x1, y1);
Image image = Image.FromFile(loc[a].InnerText);
pbox1.ImageLocation = loc[a].InnerText;
pbox1.Load(loc[a].InnerText);
pbox1.Height = 100;
pbox1.Width = 100;
pbox1.SizeMode = PictureBoxSizeMode.StretchImage;
pbox1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
pbox1.Paint += new PaintEventHandler(pbox1_Paint);
panel1.Controls.Add(pbox1);
}
}
}
void pbox_Paint(object sender, PaintEventArgs e)
{
Graphics g = e.Graphics;
Pen myPen = new Pen(System.Drawing.Color.Black, 3);
g.DrawLine(myPen, pbox1.Left, pbox1.Top, 1, 1);
myPen.Dispose();
}
}
}
yummy02
2-Jan-11 21:50pm
View
this is my code in paint event:
Graphics g = e.Graphics;
Pen myPen = new Pen(System.Drawing.Color.Red, 5);
g.DrawLine(myPen, pbox.Right, pbox.Bottom, 0, 0);
yummy02
2-Jan-11 21:27pm
View
I'd tried that one, but it did not work. The images in my pictureboxes disappear.
yummy02
30-Dec-10 0:45am
View
my code:
System.Drawing.Graphics g;
g = panel1.CreateGraphics();
Pen myPen = new Pen(System.Drawing.Color.Red, 5);
g.DrawLine(myPen, pbox.Right, pbox.Bottom, 0, 0);
my pbox is the picturebox.
yummy02
30-Dec-10 0:12am
View
Thanks, I have figured out what's missing. Last time, I user "g = this.CreateGraphics();", now that I've tried "g = panel1.CreateGraphics();", it works. Now my problem is to create a line to corresponding pbox. I want to create a lines that will connect one pbox to another.
yummy02
29-Dec-10 22:06pm
View
I'm creating a user control. Inside user control is the panel where instances of picture boxes occurs. What I want is to create instances of lines that connects one picture box to another.
I'm done with instances of picture box and its location. I'm having a problem with paint event handler. It seems that it doesn't work with panel. I'm planning to draw a line in panel(connecting pbox), but it did not work. Now I wonder if paint does work on panel.
yummy02
28-Dec-10 2:19am
View
by the way, can I create an instance of lines that will connect pictureboxes?
yummy02
27-Dec-10 21:53pm
View
Thanks JOAT-MON. By the way, what's with point_from and point_to?
yummy02
27-Dec-10 21:42pm
View
I can't still see the designer after rebuilding my project.
yummy02
27-Dec-10 21:14pm
View
@JOAT-MON : I believe it is not a WPF form.
@Walt Fair, Jr. : Actually there's no error listed but when I tried to view the form designer, all I've seen is the HTML content that I believe, I did not created. But as of now, the program runs correctly, the problem is only in the form designer.
I have a user control and I drag it to the form. Then I coded the user control and when I run my app, I did well. But when I stop the debug to add something, I'd checked the form, but the form shows html code. That's it.
yummy02
27-Dec-10 21:12pm
View
Deleted
@JOAT-MON : I believe it is not a WPF form.
@Walt Fair, Jr. : Actually there's no error listed but when I tried to view the form designer, all I've seen is the HTML content that I believe, I did not created. But as of now, the program runs correctly, the problem is only in the form designer.
I have a user control and I drag it to the form. Then I coded the user form and when I run my app, I did well. But when I stop the debug to add something, I'd checked the form, but the form shows html code. That's it.
yummy02
27-Dec-10 20:57pm
View
@SAKryukov : What do you mean?
yummy02
24-Dec-10 7:21am
View
Thanks johannesnestler. Actually, what I really want to do is to create a user control. When the form loads, the user control loads also (dragging user control to form I guess is the appropiate), then the user control reads the xml file. In xml file, there's name, x, y and path. I'll create an instances of label and picture box. In label, the name childnode from xml will be loaded. 'x and y' childnodes sets the location of picture box and label then path is the location of picture that will be loaded in pbox. The user control loads the content of xml file. After that, I have to create (draw) lines that connects each pbox. Thank you so much johannesnestler, God bless and Merry Christmas. :)
yummy02
23-Dec-10 6:17am
View
@OriginalGriff: Some user are not posting relevant comments and suggestions but they rather intrigue the people asking not considering if the user's ability to think logically. That's it. :)
yummy02
23-Dec-10 2:44am
View
I'm just a newbie in doing projects like this. Most of you here are more knowledgeable in answering user's queries. So I thought that you guys will answer and will not insult in the first place. By the way, I tagged XML, because I'm using XML file to store the name and path of my project.
yummy02
23-Dec-10 2:38am
View
Sorry guys if you thought that I'm just wasting your time in posting answers. There are times that I did not actually get some points. In that case, I keep asking. I post the question because I did no notice some points to answers. I'm just making sure of the codes. If you think that I'm just trolling, then delete my user account. Thanks for your comments.
yummy02
21-Dec-10 3:43am
View
hi johannesnestler, i just want to ask if the code you supply requires a button in loading images, because actually, what I want is to load all images by means of reading the content of xml file. The xml file contains name, x, y, path. Name childnode is the name of the image, then the path childnode is the location of the images. x and y is the location of the images. and there's no button in loading images if possible. Can you help me on that?
yummy02
21-Dec-10 2:58am
View
by the way, I have some confusion about where to place the code. Should I place the codes inside user control (usercontrol load) or in class library?
yummy02
20-Dec-10 7:23am
View
thank s for that. I'll try it tomorrow. Thanks my friend.
yummy02
16-Dec-10 0:55am
View
Ah, so you mean to say that in C#, I will be creating dll. Then that dll can be use as activeX?
yummy02
14-Dec-10 3:52am
View
Can I use ActiveX in C#?
yummy02
13-Dec-10 3:01am
View
there's so many examples on the net yet not all are working. please guide me in doing the basics. thanks.
yummy02
8-Dec-10 4:10am
View
I'm done with my project and I did install it in another computer, but I have to change some functionality in my system so i revised the project. Now that I'm done with the project, I want to get the release of it so that I would not uninstall the previous version but just patch it. please guide me. thanks
yummy02
4-Dec-10 0:26am
View
my first array consists of 38, my next array is just 6.. i want to compare that.
yummy02
3-Dec-10 7:07am
View
@Sandeep Mewara - Its not that I don't have any effort yet asking for codes. Its just that I'm a starter in terms of coding. Please be considerate if people ask questions yet can't can give enough information at the moment they ask.
yummy02
3-Dec-10 7:03am
View
actually, i have no format yet. I can't find any clear idea in putting an xml file content to the array. all i have is this:
string docpath = "c:/Configuration/myxml.xml";
XmlDocument xdoc = new XmlDocument();
xdoc.Load(docpath);
then.. xnl.count for reading xml content..
i need to know how to put the xml content to array. please help me.. thanks
yummy02
3-Dec-10 4:58am
View
i have no idea on doing that, but I will tell you on how the system goes. I have a system that lets user input numbers, then that numbers will be saved in xml file. Then, I want to retrieve the xml file and put it in array. That's it...
yummy02
27-Nov-10 9:34am
View
Hi, actually I'm confused with the xml. I try to run my application but the messagebox has given me some outputs that I did not expect. When I tried to find out the "myXmlNode", I only shows the "" message. please help me again. :)
yummy02
27-Nov-10 9:30am
View
yes, i repost it again. though Tarun's answer are so useful, I still want to find some ways but I still consider his answer, thanks Tarun. :)
yummy02
26-Nov-10 22:20pm
View
thanks for the help.. i'll try it now..
Show More