|
I am using crytal Report in C# 2005 . I want to write a progam that can allow user to add lines ,Images ,Texts and move them around at runtime . I don't know how to do it
Does anyone help me ?
Thank you in advance.
Sincerely,
|
|
|
|
|
Hello once again frends!
Well right now im stuck doing a web form...well its actually finished though the only problem i have left is how i can print my form without showing my dropdown lists and buttons.
I've come up with something though im not realy sure how to go about this. the plan is upon firing my print button (which i havnt made yet) i put the entire html into a variable (easy enough) then pass that variable into a similar page except without the dropdown lists and buttons(fairly easy)...though retreival of the html is a b*tch. quite frankly...how do i do that? is it even posible?
Sori im in such a haste...though all your post will be much appreciated.
Thanx all!
Aim small, miss small...
|
|
|
|
|
Interesting that to print your are essentially re-running the HTML through your own print logic. I'd have to agree that would be ugly but more importantly is it what you really want or do you want a screen capture of the Client Window?
The latter is pretty simple Win32 type stuff, get the application form device context: Left, Right, and size coordinates. Use a GDI calls like GetRegionData, SaveDC, etc to snatch the image, then you can either save and print or just render the image to the printer. It's probably a tad more work but at least you can design a generic screen grab and print class that you could reuse. A cool application that I have used for years is SnagIT, which does what I'm talking about but it also saves the image to your favorite file format (BMP, GIF, JPEG, etc.) Depending on how far you wished to take this you could build a mini-SnagIT for your application library.
Mike
|
|
|
|
|
My apologies for the very late reply i was on a short weekend vacation. About ur post...nice logic i thought about saving it though i havnt the sense to think it through. Then it occured to me, im not the one who will use this form its the other department (meaning computer iliterate, lazy management ). So basicaly i have to create a print function that directly prints out the form with those preferences without having to save and/or edit it. Is there posibly a way?
By the way thanks so much for reply!
Aim small, miss small...
|
|
|
|
|
hello,
i'm interested in how to get the windows color theme. i'm developing a small programm, where i need to draw my own forms. i overrided the onpaint method and the drawing works fine so far. i now want to draw some form colors depending on the actual windows colors (like the standard blue, green or silver).
does anyone know, how i can get information about this setting in c#?
best regards
pikebu
|
|
|
|
|
SystemColors and SystemBrushes may be of some use, you may also want to search for uxtheme if you want to draw themed elements.
|
|
|
|
|
i am doing here some some socket-client work in C# windows service
it is working fine for multiple clientss
now i want to limit these multiple clients to 25 for example
i want that when service starts objects for all these 25 clients
are created and when client connects it should be accepted and will not allow more than 25 clients to connect
and when client diconnects that object can be allocated to another client who requests
i am not able to make up logic how i will first create 25 objects and store them in array
and how i will be checking wether object is free or not to be allocated to another client
code:
protected override void OnStart(string[] args)
{
// TODO: Add code here to start your service.
listen obj;
Thread threadlisten=null;
obj=new listen();
threadlisten =new Thread(new ThreadStart(obj.startlisten));
threadlisten.Start();
}
in listen class listen.cs
public class listen
{
TcpListener server=null;
Thread tcpthread=null;
client cl=null;
public listen()
{
//
// TODO: Add constructor logic here
//
}
public void startlisten()
{
Int32 port = 3310;
IPAddress localAddr = IPAddress.Parse("192.168.0.5");
// TcpListener server = new TcpListener(port);
server = new TcpListener(localAddr, port);
// Start listening for client requests.
server.Start();
// Enter the listening loop.
while(true)
{
// Perform a blocking call to accept requests.
// You could also user server.AcceptSocket() here.
cl= new client(server.AcceptTcpClient());
tcpthread=new Thread(new ThreadStart(cl.getClient));
tcpthread.Start();
}
}
public void stoplisten()
{
server.Stop();
}
}
in client class client.cs
public class client
{
TcpClient tcpClient;
// Buffer for reading data
Byte[] bytes = new Byte[256];
String data = null;
public client(TcpClient Client)
{
//
// TODO: Add constructor logic here
tcpClient =Client;
}
public void getClient()
{
try
{
data = null;
// Get a stream object for reading and writing
NetworkStream stream = tcpClient.GetStream();
int i;
// Loop to receive all the data sent by the client.
while((i = stream.Read(bytes, 0, bytes.Length))!=0)
{
// Translate data bytes to a ASCII string.
data = System.Text.Encoding.ASCII.GetString(bytes, 0, i);
// Process the data sent by the client.
string replyMsg = data;
clamdCommand x=new clamdCommand();
replyMsg=x.Command(replyMsg);
byte[] msg = System.Text.Encoding.ASCII.GetBytes(replyMsg);
// Send back a response.
stream.Write(msg, 0, msg.Length);
//Console.WriteLine(String.Format("Sent: {0}", data));
}
}
catch(Exception se)
{
}
// Shutdown and end connection
tcpClient.Close();
}
}
Ankit Aneja
"Nothing is impossible. The word itself says - I M possible"
|
|
|
|
|
All you gotta do is have an IF statement check the number of clients. Now would I recommend hardcoding 25.... nope. Read the restriction quantity from a config file. That way you can change the number of supported clients without recompiling the code. Your app would read in the parameter at startup and pass it to the listen class. The you would have something like:
class listen<br />
{<br />
.<br />
.<br />
.<br />
<br />
uint mClientCount = 0;<br />
uint mClientLimit = 0;
.<br />
.<br />
.<br />
<br />
public listen(uint limit)<br />
{<br />
mClientLimit = limit;
}<br />
<br />
public void startListen()<br />
{<br />
.<br />
.<br />
.<br />
if (mClientCount < mClientLimit)<br />
{<br />
cl= new client(server.AcceptTcpClient());<br />
tcpthread=new Thread(new ThreadStart(cl.getClient));<br />
tcpthread.Start();<br />
++mClientCount; <br />
}<br />
.<br />
.<br />
.<br />
<br />
}<br />
Note: make sure you decrement mClientCount in your Disconnect logic so that you counter stays accurate. Since you are using threads, you will have to manage the synchronized access to the
client counter. You can use lock {} or use a Mutex, or AutoResetEvent depending on your preference and performance needs.
Good luck!
Mike
|
|
|
|
|
is it possible for string type constants to be declared in interfaces in C#.net?how to implement interfaces use these constants in other classes
Sridevi
-- modified at 1:29 Friday 2nd December, 2005
|
|
|
|
|
|
Hi goodmorning,
yaa it doesn't work in interfaces
Sridevi
|
|
|
|
|
|
I wrote this in interface
public interface Style
{
static const string STYLEFREEFORM = "STYLE_FREEFORM";
Error:Interfaces can't contain fields
so how to define constants?,i want to implement these are other classes..any suggestions..give me small example for this context
Sridevi
|
|
|
|
|
Why don't you use a namespace as the logical container for the interface and any constants you want to declare?
Regards,
Rob Philpott.
|
|
|
|
|
Plz give me example
Sridevi
|
|
|
|
|
|
leppie wrote: Also you cannot use the static keyword with const.
I noticed that the other day and don't understand why. Do you know?
Thanks,
Alvaro
I cannot take anything the Bush administration does seriously. The corruption, the cynical disregard for humanity, the cronyism and incompetence, all wrapped in a slimey flag of ultra-marketed nationalism repulses me. -- consdubya from fark.com.
|
|
|
|
|
Alvaro Mendez wrote: leppie wrote:
Also you cannot use the static keyword with const.
I noticed that the other day and don't understand why. Do you know?
IIRC Clarity. All consts are treated statically, and if there were consts and static consts there would be people confused about the difference (none) between them.
|
|
|
|
|
isn't that methods rather than members? Without checking the books I wouldn't have thought you could have any members in an interface. I presume we consider members and fields are the same thing in this context..
Regards,
Rob Philpott.
|
|
|
|
|
Hi Goodmorning,
yaaa in this context members & fields are same..
Sridevi
|
|
|
|
|
...hey guys ..
I m working on the search engine project.....
I urgently need any algorithm to index my database...
I can't store it using STL hash table....anyone knows ..plz tell me....
Aditya Kumar Agrawal
B. Tech. Final Year
MNNIT Allahabad
India-211004
|
|
|
|
|
First, make sure you're in the right forum (C# programming language).
There are lots of articles on the web as well as several open source search libraries that might help you out if you study them. One that comes to mind is Lucene (and the .NET port, DotLucene).
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: Bought a House!
Judah Himango
|
|
|
|
|
..Thanks for this great guidence ... really i didn't have any info regarding DotLucene ... and as i m coding my engine in C# .. so I prefer to put this question in this forum ......
once again thanks a lot
Aditya Kumar Agrawal
B. Tech. Final Year
MNNIT Allahabad
India-211004
|
|
|
|
|
Hi!
I am developing a software using c# for windows platform, and i need to know if there is any possibility of knowing when a system or user process is invoked that is before it's execution.
I will be very grateful for any help.
take care
SAM
SAM
|
|
|
|
|
Well you have a couple options depending on how much control you have over the system and/or user processes. For example, if these processes are also your own source code, then you can design some sort of Health protocol used by all the processes and the Master Service/Process. This would actually pretty fun and easy to do depending on your expertise.
Conversely if you are talking about genuine 3rd party processes, this includes Windows processes then I am afraid we have a complety different cat to skin. You know when you press CTRL+ALT+DEL to bring up the Task List, well get ready cause that is basically what you have to build (aside from the interface). If that is the case, I would have to say that doing so in C# for the sake of using C# would be kinda silly and not advised with all of the marshalling and workarounds to access system data structures`. But under Win32 and VC++ you are in the right element at least. Get the drift?
Finally unless you happen to have lying around, one computer interface to the human brain, it may be slighlty difficult to tell the future. But if your scenario matches the first option then you can ensure the first thing the processes do is use the Health protcol. If you are left with the second option remember the process that scans the Active Task List is probably a high priority process so if your application is polling this list you need to decide how often to interrogate it versus becoming intrusive to the system performance.
Mike
|
|
|
|