does visual studio 2012 premium have what youre looking for? Cause if it does i could help you out
timmyjoshua commented: hmmm!!! thanks, i think this should work... +0
does visual studio 2012 premium have what youre looking for? Cause if it does i could help you out
i ve tested your code and it works, by the way put a semicolon after your last line of code altouhg i think that this is not the problem.
listBox1.Items.Add(s);
You have to put some of your code here, you have to show what you ve done so far, after that I am pretty sure that someone will help you out with your problem.
you should post more code because this seems ok, when you click on your tool item it will just go to the maximum, though i m not sure about your registration class this class as i ve searched google doesn t exist (it s not in the library) as i can see
I not trying to be offensive but that s not the kind of stuff you post here, i asume. If you type that on any Search engine such as google, bing etc... you ll get the code for sure, doesn t have to be strictly C# but those so called beginner s things wich are using programming basics to be built are almost the same in every language.
finally, tnx, can you please suggest a site where i can look more on this , or anybody else?
Hi again,
before a year ago when we were doing the graphics class at college my professor said that the coordinate system is reversed in programming that means that the Y axe is positive when facing down and the X axe is negative when facing right , however when using the graphics class in c #, the X axe is not negative on the right side instead it is POSITIVE! i said to myself that i will learn this basics but somehow i can t find Anything on google about this and when doing some project i nearly always end up using some false coordinates and the main reason is because i am stil not sure how this coordinate system works in programming and by the way Why is it Reversed in programming ??
I think that this is the simplest way to do this.
List<string> list=new List<string>();
XmlDocument doc = new XmlDocument();
doc.Load("string path or url");
XmlNodeReader nodereader = new XmlNodeReader(doc);
while (nodereader.Read())
{
if (nodereader.NodeType == XmlNodeType.Element)
list.Add(nodereader.LocalName);
}
}
foreach (string node in list)
{
MessageBox.Show(node);
}
if you .xml file is located on your hard drive than use the OpenFileDialog class otherwise if it s on the web that put your url as a string.
the delegates, events etc... are fine , erase your dataGridView1_CellContentClick event
and try this
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex!=dataGridView1.Columns.Count-1)
{
for (int i = 0; i <= dataGridView1.RowCount - 1; i++)
{
if (Convert.ToBoolean(dataGridView1.Rows
[i].Cells["chkcol"].Value = true))
{
Frm2.ShowDialog();
break;
}
}
}
}
ok , so what should be done instead?
i dont know how to invoke the event ,
http://msdn.microsoft.com/en-us/library/system.datetime.compare.aspx ,, to Compare them
http://stackoverflow.com/questions/919244/converting-string-to-datetime-c-net ,, to convert into datetime
hy guys i have a problem with my event
public delegate void paintEventHandler(object sender, EventArgs e);
Graphics paper;
public static event PaintEventHandler After1s;
private void Mouth_shut(Graphics gr)
{
gr.FillEllipse(new SolidBrush(Color.Yellow), 50, 50, 50, 50);
}
private void Mouth_Open(Graphics gr)
{
gr.FillPie(new SolidBrush(Color.Yellow), 50, 50, 50, 50, -30, 270);
}
private void timer1_Tick(object sender, EventArgs e)// occurs every second
{
After1s += new PaintEventHandler(Form1_After1s);
// after every passed second going to Form1_Paint, INVOKE doesnt work
}
void Form1_After1s(object sender, PaintEventArgs e)
{
paper = e.Graphics;
Mouth_Open(paper);
Thread.Sleep(500);
Mouth_shut(paper);
}
I cant get my object to morph , nothing happens. I tried to invoke it but it get some errors, any advice would be apreciated.
Hy guys, haven t been here for a while,
If anyone can give me a idea or a way or a link on how to retrieve data from a website and store it in my application for further usage. The thing is that this data is being updated every month or so and when a update occurs on that website i again need this data updated in my program, so that my calculations concerning that data are always correct. My knowledge about websites are html,css, a litle bit of xml. Any advice would be greatly apreciated. I m using Visual studio 2012, C#.
I forgot to tell write to lines of code in the timer1_Tick EVENT
after
Ontimee.Invoke();
counter = 0;
timer1.Enabled = false;
In this way you will be able to reuse your app...
namespace WindowsFormsApplication1
{
public delegate void EventHandler();
public partial class Form1 : Form
{
int counter = 0;
public static event EventHandler Ontimee;
public Form1()
{
InitializeComponent();
}
private void button1_Click()
{
MessageBox.Show("Your work");
}
private void timer1_Tick(object sender, EventArgs e)
{
counter++;
if (counter == 3)
{
Ontimee += new EventHandler(button1_Click);
Ontimee.Invoke();
}
}
private void button1_MouseHover(object sender, EventArgs e)
{
timer1.Enabled = true;
}
}
}
I think that this is what you want.Have a look at events Click Here, Good luck
I wast just wondering guys how do you look at recursion , how do you apply it (i m not talking here about easy recursions like hannoi tower, factoriels, fibonnaci... wich are obvious). I m a beginner programmer and i understand the concept quite well but let s say a more complex problem appears than i would have to think hard and yet i would n t know how to apply recusion(in wich order to form the code so the recursion works on it). So my question is will i ever understand recursion, will it ever be the thing that i ll say that it s a piece of cake, and the other question is how did you guys get on with it, how did you understand it, how long did it take to fully understand(i know that some of you have abstract minds and you pick it up fast..)
PS. I know that tracing recursion is a bad idea.
hmmm, i don t understand quite. The main thing that bothers me is when the compiler gets to the recursion code inside the for loop does it leave the for loop and then again go until the base case is met and does the for loop increase or does it stay the same
It s not my code , i just want someone to explain it to me. How does the recursion behave in a loop because when tracing it then it just doesnt fit. So Please if anyone could explain it to me. I understand recursion without loops perfectly but i got stuck with this one.
I was wondering guys if you could explain me how RECURSION works inside a loop!? I got lost here so please anything we ll be much appreciated.
public void perm(int[] list, int k, int m)
{
int i;
if (k == m)
{
for (i = 0; i <= m; i++)
Console.Write(list[i]);
Console.WriteLine(" ");
}
else
for (i = k; i <= m; i++)
{
swap(ref list[k], ref list[i]);
perm(list, k + 1, m);
swap(ref list[k], ref list[i]);
}
}
im sorry, wrong and inccorect code posted!
First of all remember to use a namespace called IO by typing,,, using System.IO;
I suggest you to use this
string z=null; // make it global
OpenFileDialog ofd = new OpenFileDialog();
if (ofd.ShowDialog() == DialogResult.OK)
{
StreamReader sr = new StreamReader(File.OpenRead(ofd.FileName));
while (!sr.EndOfStream)
{
z=sr.ReadLine(); / there are a lot of methods that the streamreader provides by using the name of the streamreader in this example sr. you can acces all of them
// do someting else if you want
}
Use the open file dialog so you can open your txt file. Also you ve got a great property ofd.FileName which uses the file that you clicked on it rather than giving the path to the exact file that you want to use. at the end you just store your strings inside the variable. The loop is here because we want to read till the end otherwrise you could just use the method called ReadToEnd();
I suggest you to find more on the Net , there are so many things about it.
So i have a void method where you have to concetenate "add 4 and 3" and the result is c=43
and i want the textbox to become the c . So upon clicking the button i want to get in my textbox 43
This is just an example i have to do a simillar thing on a much larger code , but my question is why doesn t this work? I solved my problem with a string method and return statements but why can t i use a void method with the result parameter?
private void button1_Click(object sender, EventArgs e)
{
Method(textBox1.Text);
}
public void Method(string c)
{
string a = "4";
string b = "3";
c = a + b;
}
I m having a problem when sending my c# projects to a friend via e-mail. Before sending i use WINRAR to compress it however when the other side gets the mail and when it tries to open it, it get s an error ouptut saying: "application not found". When going to the folder were the archive has been downloaded and opening it from there, the program opens but it says"one or more solutions were not opened correctly". I think i didnt get you confused guys. Basically i would like you to show me the proper way how to send an c# project someone so that it is openable on the other side.
I m little bit confused. Are you trying to say that when you change the value of one cell in your case cell number 3 it is then being multyplied by the same number? Try to use
Convert.ToInt32
You should mention what type of values are you converting and more important how big are they.
"SELECT TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME = 'Total';"
shouldn t this be--> "SELECT INFORMATION_SCHEMA.COLUMNS FROM TABLE_NAME WHERE COLUMN_NAME ='Total'"
I ve tried your code and it seems ok no matter if you type in textbox1 and textbox2 a integer for example 5 or a double 5.0 . Both will give the result. "Input string in the correct format will only show if you type in everything else but not a number. To be honest with you i have no clue why you are multyplying the double with zero because we all know the evaluation, but that s your choice. Also when doing such thing try to put more brackets because at the moment i also thought as ddanbe that you will convert the second double to text which would not make any sense, but no it will do the Tostring() after summing it up, still try to use brackets.
Well i m not exactly sure what your goal is but if you want to display something you have to call your class! So you have to make a instance of it, for example
Employee em=new Employee();
and you can pass parameters to it because you created a constructor otherwise you won t have any use of it
Employee em =new Employee(value1,value2); //value1=type_int,value2=type_double
AND one other thing, before you do that be sure to insert the Namespace wich is ConsoleApplication1 by doing this
using ConsoleApplication1;
otherwise you won t be able to access your class that you creater eralier before.
One of the best sites to learn about the web is http://www.w3schools.com/php/default.asp
It s incredible i learned HTML, CSS, SQL, XML, learningn javascript...
It gives you a good understanding and you can also text your own code overthere without having a program installed on you harddrive.
So once again you will get a decent knowledge about php but after that in order to fully understand what s going on you will have to program by yourself and create some applications.
An array is something that can hold a lot values , For instance you can store one value in a variable
int a=5;
string z="bob";
char b='b';
but in a array you can store a lot of values , for instance
int [] array1=new int [3];
array1[0]=3;
array1[1]=2;
array1[2]=5;
the syntax of an array goes like this
type_of_variable [] array_name=new type_of_variable [number of elements in array];
the new keyword is here to initialize the array and you must use it.
the sign [] means that the array is one dimensional
for example if you would have this sign [,] it would be two dimensional and so on...
i suggest you to go to this site for more information
One other thing ,, array1[0] the [0] is the first array address it just means that you are storing a value the first element in the first element of the array which always has a value of 0 . The last element in the array will always have (array_size-1) address
http://www.dotnetperls.com/array
Good luck
while (!sr.EndOfStream)
{
line = sr.ReadToEnd();
string[] array = line.Split(';'); // times stored inside ,,08:10, 08:30...
TimeSpan[] array1 = new TimeSpan[array.Length];
for (int i = 0; i < array1.Length; i++)
{
array1[i] = TimeSpan.Parse(array[i]);
}
for (int i = 0; i < array.Length; i++)
{
MessageBox.Show(array1[i].ToString());
}
}
i found the answer to my question , any other suggestion will be helpfull in order to make this more convenient for further usage.
Hi guys, I m making an small aplication for buses but i got stuck with the string array conversion to a timespan array, i have to convert it i order to compare times later on but i don t know how... Here is the code
string line;
TimeSpan [] array;
OpenFileDialog ofd =new OpenFileDialog();
if (ofd.ShowDialog()==DialogResult.OK)
{
StreamReader str=new Streamreader(File.OpenRead(ofd.FileName));
while (!sr.EndOfStream)
{
line=sr.ReadLine();
string [] array=line.split(';') // time stored inside , format-->hours:minutes, example 08:10
}
If you ve got any other suggestions in order to avoid the timespan class but to be able to work with times later on then please advice.
http://download.cnet.com/FloorPlan-3D/3000-6677_4-10633732.html
Try this link,
and this one as well
http://www.linkedin.com/pub/dir/Michael/Denio (register, it should be the second or third person)
Hi guys
I have a little mess up in my head going on i dont really know why.
My question is how come a right join AND a left join were made to handle database queries, why both of them, isn t one enough?
for instance let s take the left join.
syntax:
SELECT column_name(s)
FROM table_name1
LEFT JOIN table_name2
ON table_name1.column_name=table_name2.column_name
and we get all the rows from table_name1 and rows from the other table which do have a match
Now if we SWITCH the tables
syntax:
SELECT column_name(s)
FROM table_name2
LEFT JOIN table_name1
ON table_name1.column_name=table_name2.column_name
and we get all the rows from table_name2 which we could have done with RIGHT JOIN as well but we would have to switch tables.
Once again WHY isn t a for example Left join enough why does a right join exist? VICE VERSA.
that s great, thanks!
Yep it is definetly the Parse that s causing the problem. Your variable buff always returns false and doesn t go on with the code. one more thing. after setting the result variable to 0 you are not using it anymore so just write at the end instead of result.ToString() --txtDiscount.Text = total.ToString();
Hmm, if i understood you correctly then what you want your code to do is to find a average grade of each one of the persons stored in the list. Is that right?
If I understood correctly all these stations are on the same route and Manchester Victoria is the one where the trip would eventually start so you gave it a value of 0 pounds but you can select another station and define it as a starting point.
First of all fill populate the combobox
List<string> _items = new List<string>();
for (int i = 0; i < stations.Length; i++)
{
_items.Add(stations[i]);
}
comboBox1.DataSource = _items;
Then create another combobox to define the destination(also populate).Now the main problem is that you have to add station (prices) which are between the starting point and destitanion point if there isn t anything between just add the price of the To STATION, if there is something between, for example start at index (victoria)[0] end at index(Littleborough)[3] then implement another loop to sum the prices and index 1,2,3 stop the loop after adding value at index 3.
Since you did not specify which programming language you are using i ll give you this link Link Anchor Text . It s for c# and the content is very well explained.So give it a try.
tnx that is very well done :). Now i have a much more clearer view on arrays .
while (dec_num > 0)
{
int n=0;
result = dec_num / 2;
remainder = dec_num % 2;
Storage[n] = remainder;
n++;
dec_num = dec_num / 2;
the incrementation doesn t do it , why?
i m aware that the library can do the dec-bin and the reversing but i don t want to use it also i see that it would be better to use a
do while() loop but this time i want to stick with the while loop.Obviously i forgot to put the incrementation of the array but stil with
doing it a dont get good values in my foreach loop that folows the code.Can anyone put a code or something that i need to change?
yes , i forgot to do that but still with incrementation i m not able to get my array fixed
Hi guys, as you can see i have a problem with the array , i don t know how to put every remainder in the
array and then loop it to get the reverse order, it seems that the array is being overwrited every time
the while loop goes and i don t know how to handle this.
int dec_num;
int remainder;
int result;
int n = 0;
int[] Storage = new int[10];
Console.WriteLine("Unesite broj koji zelite pretvoriti");
dec_num = int.Parse(Console.ReadLine());
while (dec_num > 0)
{
result = dec_num / 2;
remainder = dec_num % 2;
Storage[n] = remainder;
dec_num = dec_num / 2;
Console.WriteLine("The Result is " + result + "" + " and the remainder " + remainder);
}
for (int i = Storage[0]; i < Storage.Length; i++)
Console.WriteLine(Storage[n]);
Console.ReadLine();
ok,i got the idea, thanks !
Hi guys i m new around here as you can see,
i was wondering why can t the program find
the minimum of random generated numbers?Any
help would be greatly apreciated.
public static void Main(string[] args)
{
int[] randomNum = new int[10];
int min = randomNum[0];
int max = randomNum[0];
Random RandomNumber = new Random();
Console.WriteLine("Printing the interval");
Console.WriteLine("---------------------------");
foreach (int i in randomNum)
{
randomNum[i] = RandomNumber.Next(1, 10);
Console.WriteLine(randomNum[i]);
if (randomNum[i] > max)
{
max = randomNum[i];
}
else if (randomNum[i] < min)
{
min = randomNum[i];
}
}
Console.WriteLine("---------------------------");
Console.WriteLine("Maximal number is in interval <1,10> \t"+max);
Console.WriteLine("Minimal number is in interval <1,10> \t"+min);
Console.ReadLine();
}
} `