Author |
Message |
Mine GO BOOM Hunch Hunch What What
Age:40 Gender: Joined: Aug 01 2002 Posts: 3614 Location: Las Vegas Offline
|
Posted: Sat May 05, 2007 1:40 am Post subject: tcsoccerman's General Questions |
|
|
|
|
Instead of jumping over two topics, condense into here.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat May 05, 2007 11:51 am Post subject: |
|
|
|
|
Yep figured that out, but ty, that's exactly what i was asking. But since this is sorda gonna be a big database type thing, i was going to make a .cs file fora each type of word, for example, my first one will be for verbvs. i simply copyed and pasted, made the method a public method, but i get this error when i compiled:
Type or namespace definition, or end-of-file expected (CS1022) |
it is referring to the last line of the file, where a "}" is underlined as the error. what does it mean?
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat May 05, 2007 12:12 pm Post subject: |
|
|
|
|
i'll check over that again. last question, then i'm leaving. what would i do to make it after they type in the word to be translated, when they press enter, it does the button clickevent. kinda like the google thing, just to make it easier to use.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Sat May 05, 2007 2:54 pm Post subject: |
|
|
|
|
In the properties of your form, you will find 'AcceptButton' and 'CancelButton'. AcceptButton is the button to be pressed when you press Enter anywhere in the form, and CancelButton is the one for when you hit Escape
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat May 05, 2007 3:44 pm Post subject: |
|
|
|
|
That's not in csharp dev, the one doc flabby suggested. it can wait though.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue May 08, 2007 5:53 pm Post subject: |
|
|
|
|
would it be possible to make a function, in a function that is being made, something like this:
void textchoose(int labelnbr)
{
void definition(string spanish, string english, string verbending)
{
....
....
}
} |
andthen reference to it like this:
textchoose(1);
textchoose(2);
textchoose(3);
|
the purpose is to ahve multiple textboxes to type into, and then you can type phrases in as well.
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Tue May 08, 2007 7:00 pm Post subject: |
|
|
|
|
No, that's not possible in C#, but explain a bit more what you're trying to do and there may be a better method. _________________ This help is informational only. No representation is made or warranty given as to its content. User assumes all risk of use. Cyan~Fire assumes no responsibility for any loss or delay resulting from such use.
Wise men STILL seek Him.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue May 08, 2007 9:56 pm Post subject: |
|
|
|
|
I'm making a spanish translator, that will have 3 textboxes to enter a word into. there will be a button for each of those textboxes. then there will be a button that looks at all 3 words and translates the phrase vs. the sepreate words(spanish wording is different than english). i want to use the same function for each button so that when i edit one, i don't have to edit each other. i figured i must be specific in which textbox, and thought of the idea above. if this is not clear it's because i am in a hurry, and will answer any questions tom.
|
|
Back to top |
|
|
Doc Flabby Server Help Squatter
Joined: Feb 26 2006 Posts: 636 Offline
|
Posted: Wed May 09, 2007 4:43 am Post subject: |
|
|
|
|
You can do this, you just assign the same event to each button. But then use the "sender" object to obtain the correct result _________________ Rediscover online gaming. Get Subspace | STF The future...prehaps
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Wed May 09, 2007 9:25 pm Post subject: |
|
|
|
|
Can you describe how i would do this. maybe add some sample code.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Thu May 10, 2007 9:19 pm Post subject: |
|
|
|
|
if i were to do this in C:
void definitions(int textboxnumber)
{
[u] textbox[textboxnumber].Text = "test"
[/u]} |
how wouldi do the underlined part, particarily the
textbox[[u]textboxnumber[/u].Text |
part in c#?
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Fri May 11, 2007 8:39 pm Post subject: |
|
|
|
|
Nobody is answering my questions, but anyways, i am moving along quite well w/ my program, and it's of course a spanish translator. First i'll describe how it works.
1.Type in a word.
2.Click the translate Button
3.Or Press Enter(although i'll describe this more later)
4.It shows the parameters of the definition function(not part of problem, describing vaguely).
Ever since i added the key press event, it reads the text to translate as you erase it. for example, if i entered
to learn
it shows up all the translation, and how to say it such as yo aprendo, tu aprendes, etc.
then when it turns to
to lear
(from backspacing). it shows my "else" coding(meaning, if it doesn't recgonize the word). thsi is a problem because my else coding says to make it say it wasn't found, and suggests help. this is 1. unproffesional like, and 2. makes my program much more incomplete. if you could think of a way of only recgonizing the <ENTER> key press, and not backspace/letters/any other button that would be great.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Sat May 19, 2007 4:30 pm Post subject: |
|
|
|
|
I'm working on a new project(a team tracking program) and i've gotten farther than i ever expected. i learned how to save txt and how to make new forms, and apply 1 forms user entered variables to the main form. anways, i'm having a problem b/w forms.
When you click the "new" button, it gives you a new form asking things such as the teamname, tream city, team coach, etc. when the user clicks ok, it collects all the txtbox.text in each category and sets that to a value. that value then becomes a labels text in the main applicatoin/mainform. the problem i'm having is closing the OLD mainfrom. i'll post my coding here.
My "new" event handler form too enter new info:
private void Button1Click(object sender, EventArgs e)
{
string teamname, teamcity, teamcoach, teamacoach1, teamacoach2, teamleague;
teamname = txtboxcreateteamname.Text;
teamcity = txtboxcreateteamcity.Text;
teamcoach = txtboxcreateteamheadcoach.Text;
teamacoach1 = txtboxcreateteamassistantcoach.Text;
teamacoach2 = txtboxcreateteamassistantcoach2.Text;
teamleague = txtboxcreateteamleague.Text;
this.Close();
MainForm frm = new MainForm(teamname, teamcity, teamcoach, teamacoach1, teamleague);
frm.Show();
} |
and my mainform method:
public MainForm(string tmname, string tmcity, string tmcoach, string tmacoach, string tmleague)
{
InitializeComponent();
lblteamname.Text = tmcity+" "+tmname+"\n"+tmcoach+tmacoach;
lblawayrecord.Text = "0-0-0";
lbloverallrecord.Text = "0-0-0";
lblhomerecord.Text = "0-0-0";
lblplayercount.Text = "0";
} |
any ideas appreciated.
this is c# code under "sharpdevelop" compiler.
|
|
Back to top |
|
|
Samapico No, these DO NOT look like penises, ok?
Joined: May 08 2003 Posts: 1252 Offline
|
Posted: Mon May 21, 2007 12:55 pm Post subject: |
|
|
|
|
private void Button1Click(object sender, EventArgs e)
{
string teamname, teamcity, teamcoach, teamacoach1, teamacoach2, teamleague;
teamname = txtboxcreateteamname.Text;
teamcity = txtboxcreateteamcity.Text;
teamcoach = txtboxcreateteamheadcoach.Text;
teamacoach1 = txtboxcreateteamassistantcoach.Text;
teamacoach2 = txtboxcreateteamassistantcoach2.Text;
teamleague = txtboxcreateteamleague.Text;
this.Close();
MainForm frm = new MainForm(teamname, teamcity, teamcoach, teamacoach1, teamleague);
frm.Show();
} |
You don't have to declare string variables for that... you could just pass the .Text values
And I'm not sure if Close() clears stuff from memory... I'd use .Dispose(), but after the new form is shown cause no code would be executed after the Dispose (I think)
In this case, it works because frm is not shown as a modal dialog
If you'd want the first window to stay, but be disabled, you'd use:
frm.ShowDialog(this);
private void Button1Click(object sender, EventArgs e)
{
MainForm frm = new MainForm(txtboxcreateteamname.Text,
txtboxcreateteamcity.Text,
txtboxcreateteamheadcoach.Text,
txtboxcreateteamassistantcoach.Text,
txtboxcreateteamleague.Text);
frm.Show();
this.Dispose();
} |
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Mon May 21, 2007 3:31 pm Post subject: |
|
|
|
|
the only problem as i believe i stated b4 is that i'm trying to close another form, not the form that function is in. i have that "button1clickbuttonevent" in the form "addteam". i want to close the old "mainform", not "addteam".it's closing a form from another form.
also if you could answer other posts/questions i made that be greate too .
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Tue May 22, 2007 3:40 pm Post subject: |
|
|
|
|
Ok, new problem, even though NOBODY RESPONDS. Lol, w.e., you don't have to. I'm trying to assign an integer to a label, and beable to retrieve that value at other times.
I want to do this to keep a record(wins-losses-ties). Everytime i call the function it retrieves the labels value and adds 1. I don't know how to do this w/ labels. i know i can do it w/other things, but they aren't what i need(updownlistboxthing is one way). Any help appreciated.
|
|
Back to top |
|
|
Animate Dreams Gotta buy them all! (Consumer whore)
Age:36 Gender: Joined: May 01 2004 Posts: 821 Location: Middle Tennessee Offline
|
Posted: Thu May 24, 2007 8:29 pm Post subject: |
|
|
|
|
tcsoccerman wrote: | ...NOBODY RESPONDS. Lol, w.e., you don't have to. |
Lol, I'd help, but I don't know how. I just realized how much time I've been wasting this summer, too. Anyway, just think of it as helping the next guy who might have these problems.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Fri May 25, 2007 5:18 pm Post subject: |
|
|
|
|
could someone give an example of child/parent forms using...
MainForm()//mainform
AddTeam() //this is the child form
and there is a variable in AddTeam() (this is the child form)called "teamnametxtbox.Text" that i want to pass 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 . a biggie is not having a new form opening when the variables change, but just replacing the variables. I will attach the source and program here (it's slightly updated from the one in "leage manager" post). Thank you much.
Application
Team Tacker v.1.1.zip - 19.06 KB
File downloaded or viewed 48 time(s)
Source code
Team Tracker 1.1.zip - 121.58 KB
File downloaded or viewed 48 time(s)
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
Posted: Sat May 26, 2007 11:17 am Post subject: |
|
|
|
|
I don't mean to be rude, but I'll say it how it is. Nobody is responding to you because you continue to ask very basic questions that could easily be worked around with a bit of ingenuity, looking at the API, and Google searching.
|
|
Back to top |
|
|
tcsoccerman Server Help Squatter
Age:32 Gender: Joined: Jan 15 2007 Posts: 694 Location: Atlantis Offline
|
Posted: Fri Jun 08, 2007 5:50 pm Post subject: |
|
|
|
|
I'm pretty sure it's been long enough to ask another question now .
Does anyone have an idea/attempt on how i could incude players in my Team Tracker (TT) program? i thought of structures at first but i don't know if they are available in c#. ty.(again)
|
|
Back to top |
|
|
Cyan~Fire I'll count you!
Age:36 Gender: Joined: Jul 14 2003 Posts: 4608 Location: A Dream Offline
|
|
Back to top |
|
|
|