|
This looks remarkably like homework to me. Thats just the sort of Skeleton I might provide to a class and ask them to fill in the gaps!
Regardless why don't you have a crack and if you hit upon a specific issue then im sure someone here'll help you.
|
|
|
|
|
Strange, you post your message, and then the post is deleted shortly after...
My current favourite word is: PIE!
Good ol' pie, it's been a while.
|
|
|
|
|
Hi,I need a Sample code for setting for example ReportViewer1.BorderStyle in my source file.when i run my project in C#,there is a error message for this code: ReportViewer1.BorderStyle="solid".How can i write code like this without using ReportViewer Toolbar before running the project to define my Report Page setup as like as BorderStyle seting ,page setup setting for example my papaer size to be A4 and margin setting and other properties of my Report without defining this properties at running time or design time only with writing code in source file in my report from ?
thanks
D.riazi
|
|
|
|
|
Davood Riazi wrote: there is a error message for this code: ReportViewer1.BorderStyle="solid".
Surely you need to supply some kind of enum rather than a string.
What does the documentation say? (Let me guess, you haven't read it)
Well, in that case I can tell you that the BorderStyle[^] property takes an enum of type BorderStyle[^]
Davood Riazi wrote: How can i write code like this without using ReportViewer Toolbar before running the project to define my Report Page setup as like as BorderStyle seting ,page setup setting for example my papaer size to be A4 and margin setting and other properties of my Report without defining this properties at running time or design time only with writing code in source file in my report from ?
By reading the documenation. It is all in there.
Upcoming FREE developer events:
* Developer! Developer! Developer! 6
* Developer Day Scotland
My website
|
|
|
|
|
Hi dear Colin Mackay
Thanks alot for your response.
D.riazi
|
|
|
|
|
Hi All,
I am adding a string value to listbox control. I need to set the width of listbox in runtime base on how many pixels string need it to display it within listbox. Idea is to set a width of listbox exactly the number of pixels required by string value. So, I can have perfact width each time base on string value.
Any idea please help.
Thanks,
Asif.
A.Asif
|
|
|
|
|
look into the Graphics object. I think you can calculate the width of a string there, but you'll need to pass the font properties as well.
V.
If I don't see you in this world, I'll see you in the next one... And don't be late. (Jimi Hendrix)
|
|
|
|
|
TextBox tb = new TextBox();
...
Graphics g = null;
try {
g = tb.CreateGraphics();
SizeF result = g.MeasureString(tb.Text, tb.Font);
// you may need to take into account margin, padding, or border sizes
tb.Width = (int)Math.Ceiling(result.Width);
} finally {
if (g != null)
g.Dispose();
}
Jeff
|
|
|
|
|
Hello there,
Well, my question is quite simple, i'm working on synchronization between threads, and one thing i'd like to know is if there's a way to know if a thread is paused by an event.WaitOne() ...
Imagine the code below, using an eventGate declared as a ManualResetEvent acting like a gate (eventGate.Set ()= gate open, eventGate.Reset() = gate closed) :
private void myThread(){
while(!stop){
eventGate.WaitOne();
anyFunction();
}
}
Is there a way to know if i am now waiting in the WaitOne() function ?! Because i really need to in order to process the other commands in the other threads i got !
Best Regards,
Mamat,
|
|
|
|
|
Hi, you may want to read up on the Thread.ThreadState property
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi,
I've allready thought of using that property untill i realise it wasn't possible ...
Actually, using ThreadState is not reliable since threads are most of the time in WaitSleepJoin mode due to time-slicing
Best Regards,
Mamat,
|
|
|
|
|
In a process where there isn't much calculations going on (say a text editor) all
the threads are likely to be waiting for something to happen, such as a keyboard hit,
a mouse move, whatever.
In a process with lengthy calculations you will see threads that are not in WaitSleepJoin
state. Here is a simple test:
void Test() {
List<Thread> threads=new List<Thread>();
for(int i=0; i<4; i++) {
Thread t=createThread("T"+i);
threads.Add(t);
}
for(int i=0; i<100; i++) {
Thread.Sleep(300);
Console.WriteLine("tick "+i);
foreach(Thread t in threads) {
Console.WriteLine("Thread "+t.Name+": state = "+t.ThreadState);
}
}
}
Thread createThread(string name) {
Thread t=new Thread(new ThreadStart(runner));
t.IsBackground=true;
t.Priority=ThreadPriority.BelowNormal;
t.Name=name;
t.Start();
return t;
}
void runner() {
for(int j=0; j<100; j++) {
for(int i=0; i<100000000; i++) { }
Thread.Sleep(1000);
}
}
Half of the time, some of the threads are in WaitSleepJoin (due to the Thread.Sleep in
runner), the other times they are really running.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
This is what i've read from MSDN :
"Your code should never use thread state to synchronize the activities of threads."
Would be so easy that way, too bad it can't work ...
Do you have any other idea ?
Best Regards,
Mamat,
|
|
|
|
|
Karma Komae wrote: Do you have any other idea ?
Yes. Start by stating your problem.
Luc Pattyn [Forum Guidelines] [My Articles]
this months tips:
- 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 PRE tags to preserve formatting when showing multi-line code snippets
|
|
|
|
|
Hi All,
I have collection of Url's in my list box ,and these url's contain path to some .js files. What I want is that when user double click on of these url, file should open in notepad. Currently am opening a file in firefox. I don't want to download the file I jsut want to open a file. So am not using web.Client.DownLoad()
Any Idea please help.
thanks,
A.Asif
|
|
|
|
|
why not just download the file to the temp directory, then run the command "%SystemRoot%\System32\notepad.exe %Temp%\file.js". When you are done, you can delete the file, or just leave it to be deleted by the user when he or she clears the temp directory.
Jeff
|
|
|
|
|
Hi friends,
Can any one help me in, How can i read the data from MSSQl server (Let us say at x database and all tables in that database) and then convert data in to a text format and so that i can save and upload that data into [b]MySql [/b]Data base.
I was following a procedure which is satisfactory for few tables but as the table number and size grows my procedure will become a tedious one.
Anyhow i will tell the procedure i am following
I created a DataIntegrationServices Project which is available in MSSQL2005 server Business Intelligence Development Studio.
There i created a dataflowtask where we can give the origin and destination files. Origin was a OLEDB connection to connect the database and destination was a FlatFile. In this way i can convert data from one table to the text format with delimiters we select.
But i need to convert some hundred tables, can any one help me in this regard.
I use C# language for developing my applications.
Can any one suggest me an alternative or enhance the same procedure by certain modifications.
Please don't suggest third party tools which i have to buy, i prefer working with code or free available tools.
Thank you in advance.
N.Raghavendran.
Raghavendran
|
|
|
|
|
There is an open source tool here that might do what you're after.
Google is your friend. Use him, that's what friends are for.;P
"You're very clever, young man, very clever," said the old lady. "But it's turtles all the way down!"
|
|
|
|
|
Hi.
I want to notify the user when a certain background event is triggered.
I do this by showing a small form in the task bar (it is already minimized) with
the ShowDialog() method.
The problem is, however that when the form appears in the task bar, it also gets focus, so if the user is writing something in Notepad (for ex.), he is interrupted by this.
Therefore, I need a solution to prevent the new window from getting the focus.
Any ideas?
Thanks.
PS: I know that this can also be done with a notify icon, but fro now that's my second option.
|
|
|
|
|
Why not do the following...
1. Set the popup form's Visible property to false, and WindowState to Minimized in the designer
2. Create a new instance of that form (the popup window) on initialization of the class that currently calls ShowDialog
3. Instead of calling ShowDialog, change the Visible property on the popup to true
Will this work, or does it have to be a modal dialog (or does it still get focus)?
Jeff
|
|
|
|
|
|
Hi all,
I'm trying to load an image from my .resx file and place it into the image property of the toolStripStatusLabel. How can I do this or am I going at it wrongly ??
Thanks in advance
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
In a project of mine I had the images within the global resources file. To gain access to those resources I used:
toolStripLabel1.Image = global::MyProject.Properties.Resources.CloseImg;
Of course I manually inserted the images in the project's resource file.
Hope it helps.
I will use Google before asking dumb questions
|
|
|
|
|
|
Hi friends,
I have a requirement to send Messages to Mobile devices? I am new to this technology.. what is the namespace used for this?
can we import any buit in components?
How we know the providers and how we can contact with them?
How can we do it in c#?
If any one has on idea regarding this, send me the links for me
if possible send me a code for me.
thanks in advance
|
|
|
|