Click here to Skip to main content
15,891,372 members
Home / Discussions / C#
   

C#

 
GeneralRe: Listbox not updating when items are added from another thread. Pin
ptr2void24-Mar-08 19:21
ptr2void24-Mar-08 19:21 
GeneralRe: Listbox not updating when items are added from another thread. [modified] Pin
Jordanwb25-Mar-08 2:10
Jordanwb25-Mar-08 2:10 
QuestionHow to compare Date Field Value in Access Database with SystemDate and if matches then display in datagrid Pin
rizwan124-Mar-08 7:49
rizwan124-Mar-08 7:49 
GeneralRe: How to compare Date Field Value in Access Database with SystemDate and if matches then display in datagrid Pin
LongRange.Shooter24-Mar-08 8:00
LongRange.Shooter24-Mar-08 8:00 
QuestionRe: How to compare Date Field Value in Access Database with SystemDate and if matches then display in datagrid Pin
rizwan124-Mar-08 20:55
rizwan124-Mar-08 20:55 
GeneralCreatig ellipse on a picturebox and making ellipse a link Pin
Casper Hansen24-Mar-08 7:18
Casper Hansen24-Mar-08 7:18 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Christian Graus24-Mar-08 10:19
protectorChristian Graus24-Mar-08 10:19 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Casper Hansen26-Mar-08 11:16
Casper Hansen26-Mar-08 11:16 
Thank you for the answear(s)

Now I got it writing on the picturebox and when clicking on ellipse it shows a messagebox

But it only works for the last ellipse because the variable gp changes <.<<br mode="hold" />
Any idea?

Here is the code:
public void readFileToPaint()<br />
<br />
{<br />
<br />
string line;<br />
<br />
string data;<br />
<br />
string fileLocation = @"D:\msbEditor\monstersetbase.txt";<br />
<br />
using (StreamReader sr = new StreamReader(Convert.ToString(@fileLocation)))<br />
<br />
{<br />
<br />
while ((line = sr.ReadLine()) != null)<br />
<br />
{<br />
<br />
// Get rid of any trailing spaces<br />
<br />
line = line.TrimEnd();<br />
<br />
// if line is blank skip to next line<br />
<br />
if (line == "") continue;<br />
<br />
data = line; // don't need a conversion here as line is a string<br />
<br />
// Splitting data into piecesMap[]<br />
<br />
String[] piecesMap = data.Split('\t');<br />
<br />
// if piecesMap only contains one element, skip to next line<br />
<br />
if (piecesMap.Length == 1) continue;<br />
<br />
Rectangle rect = new Rectangle(Convert.ToInt16(piecesMap[3]), Convert.ToInt16(piecesMap[4]), 4, 4);<br />
<br />
gp.AddEllipse(rect);<br />
<br />
}<br />
<br />
}<br />
<br />
}<br />
<br />
public void pictureBox1_Paint(object sender, PaintEventArgs e)<br />
<br />
{<br />
<br />
Graphics g = e.Graphics;<br />
<br />
g.DrawPath(new Pen(Color.Red), gp);<br />
<br />
}<br />
<br />
private void Form1_Load(object sender, EventArgs e)<br />
<br />
{<br />
<br />
readFileToPaint();<br />
<br />
pictureBox1.Paint += new PaintEventHandler(this.pictureBox1_Paint);<br />
<br />
this.Controls.Add(pictureBox1);<br />
<br />
}<br />
<br />
private void pictureBox1_MouseDown(object sender, MouseEventArgs e)<br />
<br />
{<br />
<br />
if (gp.IsVisible(e.X, e.Y))<br />
<br />
{<br />
<br />
MessageBox.Show("");<br />
<br />
}<br />
<br />
}

GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Christian Graus26-Mar-08 12:31
protectorChristian Graus26-Mar-08 12:31 
GeneralRe: Creatig ellipse on a picturebox and making ellipse a link Pin
Casper Hansen27-Mar-08 3:20
Casper Hansen27-Mar-08 3:20 
GeneralEscape Characters in C# Pin
Vimalsoft(Pty) Ltd24-Mar-08 7:15
professionalVimalsoft(Pty) Ltd24-Mar-08 7:15 
GeneralRe: Escape Characters in C# Pin
m@u24-Mar-08 7:23
m@u24-Mar-08 7:23 
GeneralRe: Escape Characters in C# Pin
Giorgi Dalakishvili24-Mar-08 7:28
mentorGiorgi Dalakishvili24-Mar-08 7:28 
GeneralRe: Escape Characters in C# Pin
Vimalsoft(Pty) Ltd25-Mar-08 1:17
professionalVimalsoft(Pty) Ltd25-Mar-08 1:17 
GeneralRe: Escape Characters in C# Pin
Giorgi Dalakishvili25-Mar-08 7:42
mentorGiorgi Dalakishvili25-Mar-08 7:42 
Questionhow to populate a textboxi in a listview control?? Pin
pyde24-Mar-08 5:41
pyde24-Mar-08 5:41 
AnswerRe: how to populate a textboxi in a listview control?? Pin
pyde26-Mar-08 8:25
pyde26-Mar-08 8:25 
Questionverify edirectory value(?) exists Pin
4r3s24-Mar-08 4:45
4r3s24-Mar-08 4:45 
QuestionCan this code be generic? Pin
SteelIXB24-Mar-08 4:26
SteelIXB24-Mar-08 4:26 
AnswerRe: Can this code be generic? Pin
LongRange.Shooter24-Mar-08 5:13
LongRange.Shooter24-Mar-08 5:13 
GeneralRe: Can this code be generic? Pin
SteelIXB24-Mar-08 7:02
SteelIXB24-Mar-08 7:02 
GeneralLogical Ports.. Pin
ptr2void24-Mar-08 3:03
ptr2void24-Mar-08 3:03 
GeneralRe: Logical Ports.. Pin
ptr2void24-Mar-08 19:22
ptr2void24-Mar-08 19:22 
GeneralC: Send keystrokes Pin
Droze24-Mar-08 2:49
Droze24-Mar-08 2:49 
GeneralRe: C: Send keystrokes Pin
Rajasekharan Vengalil24-Mar-08 3:54
Rajasekharan Vengalil24-Mar-08 3:54 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.