Jump to content
SubSpace Forum Network

Recommended Posts

Posted
Java doesn't of course. But J# does use .NET. After some reading it says it uses the Java syntax, but cannot create trademark Java files. It creates it's own J# type of files. It's just weird. But Microsoft is always weird. So it's a clone in that it uses Java syntax, but creates its on Microsoft like files. Which leads me again, why have both C# and J#? I don't think that question can really be answered, and I have derailed this topic >.<
Posted (edited)

Back on topic, no one asked my question on giving an example of a child window.

 

I'm really sorry, but i don't get most of that. i learn best though with examples, so if you could have:

MainForm()

AddTeam() //this is the child form

 

 

and there is a variable in AddTeam() (child form) called "teamnametxtbox.Text" that i want to p!@#$%^&* to the mainform(MainForm) and make it = "lblteamname.Text". That would be pimpin. Sampapico rocks. Oh, btw, i attached the program in topic "Team Tracker Program, version 1.0". I learned how to save .

 

ty again

Edited by tcsoccerman
  • 2 weeks later...
Posted

Right now in my Team Tracker app, i'm getting to the point where i'm going to have to start incuding player recordings as well, like goals,!@#$%^&*ists.

 

i know in "C", there were structures, which went something like this:

 

struct player1

{

string name, position;

int goals, age, !@#$%^&*isists, etc.;

}player1

 

is this sord of thing possible in c#? any reasonable attempts out there? tutorials? ty.

Posted
Thank you for that , but as i look farther into this problem, the more sloppy i see my solution. i then thought of another solution, of not looking to variables for a players name, goals, !@#$%^&*ists, age, etc., but instead look to a text file. that's how i do my teamdata now. let me know if this would be a better solution. otherwise, i would have to make a struct/andor method and or class for every player. . ty for any suggestoins.
Posted

I'm getting a buggy error right now:

Code: Show/HideThe process cannot access the file 'C:\Program Files\Team Tracker\ Logo' because it is being used by another process.

 

 

I realize what it means, but i can't seem to figure out the problem. This is happening when i change photos of either the team photo, or the player photo. I use the same variables for each form, since they are in different classes. that way i could copy+paste. Here is the team photo's "picdialogbox2ok" code:

Code: Show/Hidevoid OpenpicDialog2FileOk(object sender, System.ComponentModel.CancelEventArgs e) 
  { 
	 source = openpicDialog2.FileName; 
	 Stream openbmp =openpicDialog2.OpenFile(); 
	 StreamReader openerbmp = new StreamReader(openbmp); 
	 openpicDialog2.Dispose(); 
	 teamlogopicturebox.Image = new Bitmap(source); 
	 if (File.Exists(destination+lblteamname.Text+" Logo")) 
	 { 
		File.Delete(destination+lblteamname.Text+" Logo"); 
	 } 
	 System.IO.File.Copy(source, destination+lblteamname.Text+" Logo"); 
	 photologo = destination+lblteamname.Text+" Logo"; 
	 teamlogopicturebox.Image = new Bitmap(source); 
}

 

 

and....the one for the player is the same, so i won't post that too. by the way, this is the only error i'm recieving. ty.

 

The line that gives the error is the File.Delete. Know problem occurs when a file isn't open.

Posted

		 source = openpicDialog2.FileName; 
	 Stream openbmp =openpicDialog2.OpenFile();	
	 StreamReader openerbmp = new StreamReader(openbmp);   //You start to access the file here... but you don't need it yet
	 openpicDialog2.Dispose(); 
	 teamlogopicturebox.Image = new Bitmap(source); 
	 if (File.Exists(destination+lblteamname.Text+" Logo")) 
	 { 
		File.Delete(destination+lblteamname.Text+" Logo"); 
	 } 
	 System.IO.File.Copy(source, destination+lblteamname.Text+" Logo");  //You want to copy the file (i.e. access it) but you already have it opened
	 photologo = destination+lblteamname.Text+" Logo"; 
	 teamlogopicturebox.Image = new Bitmap(source);

 

Get rid of the streamreader stuff... or move it after you're done copying the file... Else you have it accessed by 2 things at the same time.

That's what I think your problem is

Guest
This topic is now closed to further replies.
×
×
  • Create New...