|
The standard button won't do this. If a quick search hasn't turned it up already, you may have to do it yourself. Custom painting a check box is a bit tricky because you still want the OS to draw the box for you, but not the label.
|
|
|
|
|
When you say "format" are you describing something going on at run-time where someone using your application can change the color, font, style, etc. on-the-fly ?
"Beauty is in the eye of the beholder, and it may be necessary from time to time to give a stupid or misinformed beholder a black eye." Miss Piggy"
|
|
|
|
|
No. I will be creating the component at run-time, populating the text and positioning the component on a form. I'm creating a questionnaire with a varying # of multiple choice answers. Some of the available answers will have words that are bolded, etc.
Example:
Q: Are you here?
A : Yes Always
B : No Sometimes
C : Not Sure
|
|
|
|
|
Since you know the formatting of the questions in advance ... I'd consider:
1. possibly using a WebBrowser control
2. creating a UserControl (Luc beat me to it, as usual) that combines either an actual CheckBox, or a simulation of a CheckBox, with a RichTextControl.
3. doing some research here on CP (and StackOverFlow[^]) for WinForms controls that can render the subset of HTML you need (I do think there are some here on CP). And, naturally, Google[^].
best, Bill
"Beauty is in the eye of the beholder, and it may be necessary from time to time to give a stupid or misinformed beholder a black eye." Miss Piggy"
modified 28-Sep-11 10:53am.
|
|
|
|
|
As a standard CheckBox/RadioButton won't do that, you need something else, maybe an aggregation of two existing Controls. How about a RadioButton-without-text and something (a Panel, a RichTextBox, a WebBrowser) where you get the text any way you want it?
The drawback now is it's click area will not cover your text. A possible remedy is to have a RadioButton-with-text where ForeColor equals BackColor, effectively hiding its text. The other control then needs to be click-through, which probably simply means disabled. Another possibility is you execute a RadioButton.PerformClick inside the Click handler of your text displaying Control.
|
|
|
|
|
You could put one of these[^] labels next to the checkmark. Don't forget to hook up the keyhandler to toggle the checkbox when the label has focus and the user presses the space-bar.
Bastard Programmer from Hell
|
|
|
|
|
I am new to SIP and i have been the Lumisoft examples for SIP Call Out and SIP UA. I am having a big problem making a call. I can call another SIP client and the call will be received. However, my application does not recognize the response form the other end. For example, even if the call is picked from the other end, my application still keeps on ringing.
About the incoming call, from wireshark, i can see that the call is going through but the application does not seem to be noticing this. Has anyone used this API? Kindly help me know how i can listen on the incoming calls, especially that. And how can i ensure that the response is well received on my end to ensure that if someone accepts a call, i can actually initiate a dialog?
|
|
|
|
|
There are lot of client/ Server tcp chat program but they all are doing broadcasting.
I want a program where i can talk to a specific client-to-client.
I know there is
serverSocket.LocalEndPoint and
serverSocket.RemoteEndPoint which can be used.
Is there any good article or program which I can use as reference to develop this program
|
|
|
|
|
There are lots to be found through Google[^], but you may need to read through a few to get one that matches your exact needs.
|
|
|
|
|
nitin_ion wrote: I want a program where i can talk to a specific client-to-client.
There are some articles here in CP about chat applications that support private messaging, if that's what you mean. Take a look.
A Complete TCP Server/Client Communication and RMI Framework - Usage[^]
LanTalk[^]
Or you can choose what you need on the list of articles here[^]
Signature construction in progress. Sorry for the inconvenience.
|
|
|
|
|
The server needs to hold a map of client sockets to user names, and then when you request chat to a particular user, the server looks up the socket and sends a message only to that one.
My lobby server does this by using the socket ID number and storing user information including that ID. Joining a game, chatting within a game or PMing another user use the member IDs to route messages. But (i) that uses my socket library and (ii) does a lot more than just this, so it may not be a good example.
|
|
|
|
|
Since socket is internetwork and they all are connected to server with same port and IP.
When i try to send message to a particular client using RemoteEndPoint and IPAddress
var ip = new IPEndPoint(i, j) it still send messages to all clients.
Then how can i connect to a client?
|
|
|
|
|
A client will always send data down the same socket (to the server). It must put something in the message to indicate its target, and the server needs to look at the message to decide what to do with it.
|
|
|
|
|
So if i send the target to server along with message, the problem still remain the same.
should then i use <pre>var ip = new IPEndPoint(i, j)</pre> with port as RemoteEndPoint and then use <pre lang="c#">SendTo(Message, Address)</pre> to send.
is that what you are saying?
|
|
|
|
|
In the server, look at the message that the client sends. If it specifies a particular target for the message, look that client up in the list of currently connected clients (by ID number, username, etc), and send to that socket.
Note that this is not really 'client to client' (peer-to-peer), you are still chatting through the server. TCP is always client-server. You could have each instance of the chat app try to start a server and connect directly between users, but that's usually not what people want – they want to be on one server with lots of people but be able to send messages to only a subset of them. That's server side logic and you need to write it.
|
|
|
|
|
Thanks, I have done some changes to the server code and now it is sending it to particular client if it is there.
But there has to be some nmodel where peer to peer is poosible may b using some othe protocol but i guess it should be there.
|
|
|
|
|
Peer-to-peer services require that each peer can see each other peer*, and each peer is capable of receiving data directly from anywhere. In TCP that means every peer must run a server; with UDP it means every peer must be globally visible for incoming connections. If you already have a chat room running on a server, I don't understand why you'd want to get into that.
Peer-to-peer is useful if your server has limited bandwidth and some of the transactions are bandwidth-saturating, if latency is critical or if you have legal concerns about the data being resident (however transiently) on your server. File sharing, the traditional home of P2P, is mostly about the first and a bit about the third. I don't see how any of them apply to a chat service.
* – at least, all the peers that are in the group you want to be able to communicate with.
|
|
|
|
|
You should save the client's socket address as a result of the EndAccept() method. you can then use that socket to communicate with the individual client. If you are dealing with multiple clients then you need to have some sort of login protocol that allows you to map a socket to a particular user. TCP/IP Chat Application Using C#[^] uses this method and should help to explain things for you.
|
|
|
|
|
The way i did was sending the user name to server and a flag with the client with which i want to communicate.
Then server send the message to that particular client on that socket.
So this looks like peer to peer but it is not. It is actually Client -to Server -to - Client.
I guess there should be some way in which we can have Peer ro Peer, may not be using TCP but something else.
|
|
|
|
|
i have textbox that do something on GotFocus.
how i can disable the GotFocus on this textbox ?
and how to enable it back ?
thanks in advance
|
|
|
|
|
Presumably you are talking winforms!
GotFocus is an event, you can't disable it, you can disable the control or you can handle the problem inside the event.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
if you want to disable a textbox, you can use
textbox.enable = false; and true to reanable it ofc.
If you don't like this solution, you can try to overwrite the GotFocus method to only do "something" if you want it.
|
|
|
|
|
Gali1978 wrote: how i can disable the GotFocus on this textbox ?
textBox1.GetFocus -= this.textBox1_GotFocus;
Gali1978 wrote: and how to enable it back ?
textBox1.GetFocus += this.textBox1_GotFocus;
Alternatively, you could set a flag to indicate your "disabledness" and act on that;
bool isFocusEnabled = false;
void this.textBox1_GotFocus(object sender, EventArgs e)
{
if (!isFocusEnabled) then return;
} That'd allow you to disable/enable the execution of the event with a simple boolean.
Bastard Programmer from Hell
|
|
|
|
|
We are producing proofs of files we intend to print; however, the files are sometimes 80 mg in size. Producing a proof with variable data is not an issue. The issue is the amount of time it takes to open and view the pdf's over the web; therefore, the question is...
Is there a way to automatically reduce the resolution of the pdf using C#, VB, C++ or iTextSharp?
Thanks,
Steve
|
|
|
|
|
You'd have to recompose the entire document in order to do that. Any "oversized" pictures would need to be resampled to a lower resolution and put back into the document to reduce it's size. You might just want to compose two documents instead. One with reduced size pictures and another with "normal". If they want the "good" one, you can provide a link to the second download.
|
|
|
|