|
I am using Graphics to draw a rectangle to indicate a new location of a control as the users move the cursor around.
Now the thing is my rectangle, when moving over other controls, is covered by other controls. How do i change the z order of the graphics so that i can see the whole rectangle while moving it over a control?
Thank you so much for reading and please help me out
Elapid For The Win
|
|
|
|
|
There are two methods inherited from Control to perform this:
BringToFront() and SendToBack() . They do what their names imply.
Regards,
mav
|
|
|
|
|
i have found the code here (http://www.codeproject.com/dotnet/CSharpWhiteboard.asp) ,but it only can be used by two users . unfortunately, i need one which can support many users (i know that it need a server ,and need to use SOCKET) .
how to finish it ??? need to help !
thanks !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
can u send me some useful things about it ?
my email------------- saxon_100@hotmail.com
need helps . i know there are many master-hand
|
|
|
|
|
hii all;
am facing a real problem. i need directx help with c# but every time i download SDK i find only help with c++.
where do i find SDK with C#?
thanx form your time.
marcoryos
|
|
|
|
|
The SDK contains C# help and C# samples. If you don't see them, you've not downloaded the latest SDK. Actually, I think when you install the SDK you need to choose the managed stuff. Certainly when you install the runtime, you need to include the /manageddx switch, or you get nothing.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Is it possible to get leeters of the drives of the system, but only hard-drivaes (no cd, dvd etc)? I only could find a method that reads all system drive letters no matter what they are.
//Kordzik
|
|
|
|
|
Take a look at the System.Management namespace.
With a WMI search like "select * from Win32_Volume " for a ManagementObjectSearcher you can get all the volumes attached to the system and then query their properties.
Regards,
mav
|
|
|
|
|
Since you want specific drives, you would have to check the drive type. The way I would do it is by using the System.Management namespace and execute a WqlEventQuery to check the drive type (e.g. type 5 means it's a cd-rom). Check
this[^] for more info. Hopefully it will clear a bit things out for you.
Polis
|
|
|
|
|
i got an application that contains a text box, i want to draw lines depending on the TextBox input. I know how to draw, but how could I make the drawings dependent on TextBox input.
thnx in advance
|
|
|
|
|
You could elect to only draw the lines after there was input from the user, and you could use the user's input to determine where to draw the line?
Why not provide text boxes for start and end coordinates, and a button to initiate the drawing of a line. By pressing the button, the user would be indicating that they are satisfied with their origin/termination coordinates. The logic to draw the line would simply convert the text input from the user to integer values, and use those values when rendering the line.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
Hello,
I am trying to upgrade an existing Dental application by adding visual-representation of the human jaw, and allow the user (dentist) to be able to color each tooth. (For instance, a red sign on one of the tooth's corner would designate a filling).
More specifically, I need to find resources for finding out the best way for:
1. Representing the jaw (e.g. a bitmap for each tooth, or one bitmap for the whole jaw)
2. Being able to actually paint different parts of each tooth with different colors
3. Being able to store the new drawings for each tooth in the database with the rest of the patient's info (MS Access DB)
ANY help from anyone who had to do something like this before, or anyone who has any ideas would be greatly appreciated.
Thanx
Polis
|
|
|
|
|
Sounds interesting. In how many dimensions you want that visual representation? 2D or 3D? (assuming computer will have some better graphics card)
From the top of my head, I'd say #3 you don't store anything... draw it from information already in DB, no? There is no need to store information twice. Or do I miss something?
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Since this is purely a Dental application, there is no need in over-complicating things, so it's going to be a 2D visual representation (at least for start )
Regarding my #3: The user (dentist) will have limited options in the designs he/she can do on a tooth (for instance, 1 specific design for a filling, or a big red "X" sign over a tooth designating that the specific tooth is absent on the specific patient). It won't be a free-hand painting or something like that. Therefore, a there is a table in the DB which contains all of the possible designs and each time the doctor alters a tooth, that new (predefined) design will be stores in the patient's table as well.
Hope I've clear things a bit.
Polis
|
|
|
|
|
hmm my understanding is that there already is DB with information like fillings/missing tooth etc. for every tooth. (As you said you want to do visual representation, not to rewrite DB schema ) So you'll take these information from DB and render jaw from information you have there... example: in DB is that user #123 has one missing tooth at position 5 (or something, dunno). So you have somewere bitmaps for tooth OK, tooth with filling, missing tooth etc. ( not for every patient, only once!) and render all of them according to information form DB. After some change (e.g. on visual model you right click and set filling for tooth on position 7) you change this information in DB, like you did without visual representation. Maybe some kind of misunderstanding is going on?
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Yes David, what you are saying is making sense to me. You are right, I got the whole thing wrong in my mind.
So, what you are saying is that I keep a folder with all the possible bitmpaps for each tooth. Then, in the application the doctor selects the bitmap for the specific tooth (e.g. by right-clicking on the tooth) and apply it. Then, this change is saved in the Patients table for the specific patient (e.g. by saving the bitmap filename). Correct?
However, I am still wondering what is the best way for representing the jaw thing on the form. What do u think? A series of bitmaps (1 for each tooth) would be solution that fits the above logic right?
Any ideas on where I can get some resources? e.g. all-ready made bitmaps of a human jaw etc? Cause my research didn't really pay off.
Polis
|
|
|
|
|
Polis Pilavas wrote:
So, what you are saying is that I keep a folder with all the possible bitmpaps for each tooth.
Yes. There are only about 32 * number of "designs" of them so no big deal I think.
Polis Pilavas wrote:
Then, this change is saved in the Patients table for the specific patient (e.g. by saving the bitmap filename). Correct?
Almost correct. I don't like bitmap filename semantics here. You (should) want to represent state of tooth, not picture. In simple model, you'd have table like
- left_upper_filling | left_upper_filling.bmp
- rigth_upper_filling | rigth_upper_filling.bmp
.... something lke that. Point is whan you have table like this is you can change your pictures from bmp to wmf or something only on ONE place in DB. Plus if you take advantage of transparent pictures you can easily blend some images together, e.g. to make tooth with two fillings on different sides or something like that.. I don't know, there is midnight again so I may not be 100%
I still don't know how you want result look like... Something like this[^] ?
Oh wait... do you want to use real pictures of patient's teeth? I doubt it, but it would be ideal way IMO. ( but nobody's gonna pay it nor make photos of patient's teeth on every change, keep it real )
Polis Pilavas wrote:
Any ideas on where I can get some resources? e.g. all-ready made bitmaps of a human jaw etc? Cause my research didn't really pay off.
Google Image search? Mostly copyrighted material I guess, but in general you should find medical/scientific sites and there you may eventually ask them for some material... hard to say.
I don't know how much you want to spent on it or even how much freedom you have, so some of my ideas may sound crazy. But I better write 'em down then forget them.. what if they were useful?
p.s could you post screenshot of your result one day? It would be cool! Or article maybe
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Thanx David, u've been really helpful. I got ur point.
I am gonna figure out what type of images I am going to use and take it from there. I don't really know yet, but most probably (99%) I am gonna apply the technique we talked about tonight.
Yes, I've been thinking of posting an article on this once I finish it. Although it may take a while cause this is a "side" project . I will post one someday though.. hopefully some people might be interested or face similar problem for a different application.
Thanx again David
Regards,
Polis
|
|
|
|
|
If all you're interested in is an idealized representation of an (adult) human jaw, with markings that vary on a per-patient basis, why not use a single image for the jaw, containing all of the teeth in a normal human (adult) jaw?
You could then store only the modification data for each patient, representing each modification as a row of data (e.g. with columns for the modified tooth, the position of the modification, code for what the modification is - filling, bridge, root canal, extraction etc).
That way, when you rendered a patient's jaw graphically, you could just overlay the modifications on top of the jaw (using descriptive glyphs or icons) without having to store an image for each type of modification.
Just another possible direction.
The most exciting phrase to hear in science, the one that heralds the most discoveries, is not 'Eureka!' ('I found it!') but 'That's funny...’
|
|
|
|
|
yeah that's good possibility. Only problem could be to find icons descriptive enough. But, maybe it's not as problematic as find real picures...
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Yes, this sounds interesting as well, however needs much more work to implement than the other direction.
I am gonna figure out what I am gonna do and let u know guys.
Thanx for ur directions.. really interesting
|
|
|
|
|
i told all of you before that i am designing new chat messenger but i really find some great troubles in my application i really want help from anybody knows how to deal with C# networking and its facilities in that type of things.........
>>>> at the server side<<<<<<<
here i created void method to handle the connection of clients upon specific port ...
and i created new thread to handle the connection of multiusers who will connect to the server at any time
and i replaced my thread in the constructor of my main program
as
..............................................
Thread readthread = new thread( new threadstart(runserver));
readthread.start();
...................
and that method in that delegate is like that
...........................................
public void runserver()<br />
{<br />
int counter = 1;<br />
try<br />
{<br />
server = new TcpListener(5151);<br />
server.Start();<br />
do<br />
{<br />
try<br />
{<br />
listBox1.Items.Add("Waiting for connection");<br />
connection = server.AcceptSocket();<br />
socketstream = new NetworkStream(connection);<br />
reader = new BinaryReader(socketstream);<br />
writer = new BinaryWriter(socketstream);<br />
writer.Write("server :" + " Welcome Client");<br />
listBox1.Items.Add("Connection " + counter + " Recieved");<br />
string message ="";<br />
do<br />
{<br />
message = reader.ReadString();<br />
listBox1.Items.Add(message);<br />
<br />
}while(connection.Connected);<br />
}<br />
catch(Exception)<br />
{<br />
break;<br />
}<br />
listBox1.Items.Add("Client Terminated the connection");<br />
connection.Close();<br />
reader.Close();<br />
writer.Close();<br />
socketstream.Close();<br />
++counter;<br />
}while(true);<br />
}<br />
catch(System.Exception caught)<br />
{<br />
MessageBox.Show(caught.Message);<br />
}<br />
}<br />
that worked with me when i started my server application and started my client application . It only accepted one client connection but when i tried to start new client window it didn't accept it and nothing was written on my second client window like the proper message in the previous code ((Writer.write("Server:Welcome Client");)
tell me in god sake how can i make it accept clients not only one client
i will be very thoughtful for any help
thank you your brother
>>>>>Snouto Override<<<<<<
Miss With The Best And Die Like The Rest
|
|
|
|
|
There is one problem in your code. All the code runs on one thread - so you just can handle one connection.
To avoid this effect you should start one thread per client.
At the point where you accept the socket you shoul openn a new thread and give it the socket.
As a result the main thread isn't blocked anymore and can accept new connections.
So it should be possible to handle multiple connections.
|
|
|
|
|
you mean my friend that i will add new thread after the code that accept the socket connection upon client request
you mean my code will be like that
-------------------------------------------------
public void runserver()
{
int counter = 1;
try
{
server = new TcpListener(5151);
server.Start();
//loop until recieveing connection request from the clients
do
{
try
{
//inform at the server side that it is waiting for connection
//from clients
listBox1.Items.Add("Waiting for connection");
//intialize new socket connection upon client request
connection = server.AcceptSocket();
//////////////////////////////////////////////////////
//here what did you told me... you mean like that
Thread Anotherthread = new thread(new threadstart(runserver));
Anotherthread.start();
/////////////////////////////////////////////////////
//intialize new network stream connection
socketstream = new NetworkStream(connection);
//intialize new binary reader and binary writer to the network
reader = new BinaryReader(socketstream);
writer = new BinaryWriter(socketstream);
//inform the user that there was new client connection
writer.Write("server :" + " Welcome Client");
listBox1.Items.Add("Connection " + counter + " Recieved");
string message ="";
do
{
message = reader.ReadString();
listBox1.Items.Add(message);
}while(connection.Connected);
}
catch(Exception)
{
break;
}
listBox1.Items.Add("Client Terminated the connection");
connection.Close();
reader.Close();
writer.Close();
socketstream.Close();
++counter;
}while(true);
}
catch(System.Exception caught)
{
MessageBox.Show(caught.Message);
}
}
Miss With The Best And Die Like The Rest
|
|
|
|
|
I wrote a program that I call GameServer that can be run either in server or client mode (i.e. you would run one instance to fill the role of "server" then you can have multiple "client" instances). The server accepts and identifies the individual clients and even has "chat" windows that are displayed on each client box that get updated from every connected client.
If you would like to see this code I can zip it up and e-mail it to you - just let me know. You could pull the essential elements out of the code and use what you need.
dpb
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Hi , i am actually beginner with C#, so i have a simple question. I Have a form "Form1.cs" and "Form2.cs" so
when i press button , in "Form1.cs" , i want simply the Form2 dialog to show up.
And one more thing how can i programatically set font
of a textBox ??
Regards
m0n0
m0n0
|
|
|
|