|
Hello everyone.
Hope someone can help me here.
I've built a basic image printer and I need to add a small 2-line table to every page that it prints.
Any ideas on how to accomplish this? I can provide code samples if necessary.
Thanks in advance.
Scott
|
|
|
|
|
yep, just like your drawing an image, draw the table where you need it
you have to create the table drawing yourself
i.e.
Graphics.DrawRectange(...);//draw your table
Graphics.DrawString(...);draw the text
If only MySelf.Visible was more than just a getter...
|
|
|
|
|
Heh, unlike a lot of things in the world of computing, that actually makes sense. Am annoyed at myself now for not thinking of that.
Thank you very much.
|
|
|
|
|
If only MySelf.Visible was more than just a getter...
|
|
|
|
|
how to convert array list into single string seperated with spaces
the quieter u become more u hear
|
|
|
|
|
You'd wanna look at the String.Concat[^] method.
Kristian Sixhoej
"You can always become better." - Tiger Woods
|
|
|
|
|
string result = "";<br />
foreach(object item in ArrayList)<br />
{<br />
result += item.ToString() + " ";<br />
}<br />
result = result.TrimEnd(new string[]{" "});
that should do it
If only MySelf.Visible was more than just a getter...
|
|
|
|
|
You can better use the StringBuilder for these kind of operations, they are faster:
StringBuilder result = new StringBuilder();
foreach(object item in ArrayList)
{
result.AppendLine(item.ToString());
}
String result2 = result.ToString();
Now you have them seperated by a linebreak.
You can also just use the append like this to separate by spaces:
StringBuilder result = new StringBuilder();
foreach(object item in ArrayList)
{
result.Append(item.ToString() + " ");
}
String result2 = result.ToString();
result2 = result2.Remove(result2.Length-1);
|
|
|
|
|
Deresen wrote: result.Append(item.ToString() + " ");
when result is a StringBuilder you should not use string concatenation at all!
Instead do:
result.Append(item.ToString());
result.Append(" ");
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get
- use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Friday, June 10, 2011 11:43 PM
|
|
|
|
|
thanks a lot
its working fine
the quieter u become more u hear
|
|
|
|
|
Try this,
ArrayList temp = new ArrayList();
temp.Add("A");
temp.Add("B");
string delim = " ";
string result = string.Join(delim, (string[])temp.ToArray(typeof(string)));
|
|
|
|
|
Hello,
I started on the batchs programs , and I must do the following triat in batch mode:
1: Read a CSV file, all addresses line by line.
2: Open a Word file by writing the lines of the CSV.
How i can this treatment be done in batch mode? thank you very much
|
|
|
|
|
What do you mean by "batch mode"? Is it that you need to do this for many files, or do you mean that it's a console application?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
i mean the automatique mode of traitments, when we excute the batch file he do the traitment on CSV file, thank you.
|
|
|
|
|
Sorry, that still doesn't seem to make any sense
|
|
|
|
|
I don't think anyone has understood what is it that you want.
Do you want to write a programme in c# or do you just want to know how to start Microsoft Word via a batch file which you can run from the windows command prompt?
If it is a batch file you want then create a text file with notepad and name it e.g. batch.cmd
In the file write one line
start winword "datafile.csv"
Substitute datafile.csv with the path to your csv file.
Alan.
|
|
|
|
|
Or look into writing a macro in Word.
|
|
|
|
|
Hello
Forgive me if this is the wrong section ...
maybe someone know a web service that give the weather in the world ?
i need it for shcool project...
thanx
|
|
|
|
|
|
|
hi
how to create GUI for back end so that we can create and alter the database
for MS SQL using C# in Windows application.
|
|
|
|
|
create a form -> put on some controls -> make the controls do sql stuff
now you have an idea you can give it a try, then come back if you get any specific problems (other than 'i cant be bothered to try myself so someone give me the code' syndrome)
If only MySelf.Visible was more than just a getter...
|
|
|
|
|
How about simply using Management Studio? If you don't know how to create an application I suspect you are going to be struggling with the SQL even more
Bob
Ashfield Consultants Ltd
Proud to be a 2009 Code Project MVP
|
|
|
|
|
|
I wrote the following query in sql server 2005 but it didn't work.
SELECT Branch_no, no_of_employees, in_date, The_in_time, the_out_time FROM (
SELECT Branch_no, count(emp_no) as no_of_employees, in_date,
Cast(DATEPART(HOUR,in_time) as varchar(2)) + ':' +
Cast(DATEPART(MINUTE,in_time) as varchar(2)) The_in_time,
Cast(DATEPART(HOUR,out_time) as varchar(2)) + ':' +
Cast(DATEPART(MINUTE,out_time) as varchar(2)) The_out_time,
FROM Attendance
group by Branch_no, in_date )
WHERE The_in_time >= '6.00' ;
Actualy what I want is to get no of employees in each branch who has come to the office after 6.00 AM. I had to cast datetime fields to extract the time portion because it holds both date and time parts.
ex: 01/01/2009 06:00:00 AM
pls help me regarding above matter.
thanks in advance.
|
|
|
|