|
Hello
Thank you for your kind advice. I'll make sure to dispose managed objects I create. Also I'd be happy to read an article -specially if you wrote it- about when to dispose and when to leave that to the GC.
About the Alt-Tab!! Nice catch!!
Extra Regards
|
|
|
|
|
Hello
If you were following the conversation I as having with mav.. There will be a slight change in the code for the sake of optimization
private bool DrawBox = false;
private void textBox1_MouseEnter(object sender, EventArgs e)
{
Drawbox = true;
}
private void textBox1_MouseLeave(object sender, EventArgs e)
{
Drawbox = false;
}
private void textBox1_Enter(object sender, EventArgs e)
{
Drawbox = true;
}
private void textBox1_Leave(object sender, EventArgs e)
{
Drawbox = false;
}
private void textBox1_Paint(object sender, EventArgs e)
{
Graphics g = textBox1.CreateGraphics();
if(DrawBox)
g.DrawRectangle(new Pen(Brushes.Red, 3), new Rectangle(0, 0, textBox1.Width - 5, textBox1.Height - 5));
else
g.DrawRectangle(new Pen(Brushes.White, 3), new Rectangle(0, 0, textBox1.Width - 5, textBox1.Height - 5));
g.Dispose();
}
i hope that work mav.. Thanks!
Regards
|
|
|
|
|
Formally, this could work (although you don't have to create a Graphics object - the Paint event has one in its event args - and your rectangles will not be centered), but unfortunately in real life it doesn't.
It's because the TextBox isn't signalling a Paint event to a caller out of the box and thus your rectangle isn't painted.
You could derive from TextBox and set some control styles (UserPaint, mainly), but altogether the effect is not worth the trouble IMO...
Regards,
mav
--
Black holes are the places where god divided by 0...
|
|
|
|
|
i want to add first column of datagrid as checkedbox against every row of datagrid. then from the list i will select some checkboxes according to need.how i will implement this thing plz tell me any simple way.
reply soon.
|
|
|
|
|
Can you elaborate?
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
yes i have tried all even i read many articales in codeproject also. they are very complex and webbased. i dont understand them i read one artical
http://www.codeproject.com/aspnet/ChkBoxInGrid.asp
i want to do the same thing but in windows form. i dont understand how to bind checkbox with datagrid.and i want to display checkboxe with every row of datagrid. so plz help me
|
|
|
|
|
To add a checkbox column just open the Column designer and add a column of type DataGridViewCheckBox .
If you want to perform the selecting and deselecting etc, why you can just use Control and Shift combinations to achieve the same thing. There should be a property called SelectedRows so you can enumerate them.
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
I'm working on a HTTP(S) proxy and I got the HTTP part working complete with authentication.
Only HTTPS keeps buggering me, how should I handle this?
Do I need to setup a connection and just relay the data between the client and the server?
Because if I do that, the user is unabe to request another URL afterwards, at least with HTTP 1.1 and internet explorer 6/7 that is.
For HTTP I made the relaying part work by intercepting each request from the client and handle it as if it were a request for the proxy. That works great, but I'm unsure about HTTPS...
Any ideas on how to get this part to work?
WM.
What about weapons of mass-construction?
|
|
|
|
|
I have a class library I wrote, which deals with sockets.
I raise events through this library, such as DataArrival (which gives me the problem btw).
This is a snippet from my receiveCallback function:
Buffer bf = (Buffer)result.AsyncState;
bf.QueuePacks();
if (OnDataArrival != null)
{
if (caller != null) caller.Invoke(OnDataArrival, bf);
else OnDataArrival(bf);
}
sck.BeginReceive(bf.Data, 0, bf.Data.Length, SocketFlags.None, new AsyncCallback(receiveCallBack), bf); Buffer is also a class I wrote, and caller is a reference to a form.
This code works most of the time.
I'm currently working on a new project which uses my class.
In this project, I sometimes get an "Parameter is invalid" exception, on this line:
caller.Invoke(OnDataArrival, bf); It works most of the time, and never happend in my previous projects.
Is it wrong to invoke an event?
What's wrong with my parameters?
|
|
|
|
|
shyagam wrote: Is it wrong to invoke an event?
What's wrong with my parameters?
Care to provide some more details?
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
Ed.Poore wrote: Care to provide some more details?
Well... I don't really know what details I can give you...
Could you please point me in the right direction?
Ed.Poore wrote: As of how to accomplish this, have you ever tried Google?
Of course! That's how I knew I should use the Invoke method...
|
|
|
|
|
I meant details as to the exception, stack trace etc.
Nader's advice holds strong though.
As of how to accomplish this, have you ever tried Google?
|
|
|
|
|
Hello
shyagam wrote: I sometimes get an "Parameter is invalid" exception
You said "Sometimes", while other times not!! try debugging each call-;P- to Invoke, and see the values of the parameters, what's wrong with them. Also try to understand the pattern of the exception. Maybe a certain call is the problem. When the code works sometimes, it should work all the tims. So another code could be causing the problem.
shyagam wrote: never happend in my previous projects.
I guess this should point you to the possibility that the problem is in the current project!!
Regards
|
|
|
|
|
I have inserted a DataGridViewCheckBoxColumn in a DataGridView. But whenever I click on its DataGridViewCheckBoxCell, the box is not checked. How do I check it? Is any event needed?
dgvcbc = new System.Windows.Forms.DataGridViewCheckBoxColumn();
dgvcbc.HeaderText = "Check to delete";
dgvcbc.Name = "Check to delete";
dgvcbc.CellTemplate = new DataGridViewCheckBoxCell();
dataGridView1.Columns.Insert(0, dgvcbc);
Thanks!
|
|
|
|
|
Hello
The problem is for sure NOT in the code that you've posted. Are other columns in the DataGridView working too?!! Maybe you've set the eable to false by mistake or something. The above code should work fine!!
Regards
|
|
|
|
|
Hi,
There is only one DataGridViewCheckBoxColumn in the DataGridView. Other columns are mainly DataGridViewColumn and DataGridViewLinkColumn. The links work perfectly.
You mentioned the setting problem. What do you think has been set to false by mistake? What is the code for that setting?
Thanks again.
|
|
|
|
|
Hello
Well, as I told you in my previous post, this code should work!! You can tamper with the settings of your DataGridView in a way that it may stop responding. I gave you an example. Check the Enable prpperty of your DataGidView.
Also check to see if you've made this column as ReadOnly . You can check both from the property grid.
When I asked about other columns, I meant are they working in any how?? Can you edit the cells??
Regards
|
|
|
|
|
Hi,
Do you mean the dataGridView.Enabled property? But it is set to true which allows user interaction. And the CheckBoxColumn isn't set to ReadOnly. So what else should I check?
Thanks!
|
|
|
|
|
Hello
Well, err... Yes! Forgive the typo. I mean Enabled.. I'm running out of guesses here. Try to add another CheckboxColumn, and see what happens. Also you didn't answer my question. Do other Text columns work? Can you type in them?
Regards
|
|
|
|
|
Hi,
It's working now. I found out that the datagridview is readonly though I checked that the checkboxcolumn is not readonly.
Anyways, thanks very much for your help.
|
|
|
|
|
I need to know how to edit a combobox on a web page in a webBrowser object (using MSHTML). The code for the combobox in HTML uses the SELECT and OPTION tags. I can check the checkboxes, fill the textfields and click the buttons, but I can't figure this one out. Any help would be appreciated! Thanks!
Scott Clayton (My birthday was on the 23rd!)
|
|
|
|
|
Hi Everybody!
Can anyone recommand program that creates and HTML in MSDN style out of the xml documentation?
I've been looking for one on the web, but strangly I couldn't find one! (I thought there would be dozens!)
Thanks!
|
|
|
|
|
Hello
Green Fuze wrote: Can anyone recommand program that creates and HTML in MSDN style out of the xml documentation?
Sounds very much like a tailored program. And what do you mean by MSDN style exactly?!!
Also what Xml input will you give it to the program?
Regards
|
|
|
|
|
Nader Elshehabi wrote: And what do you mean by MSDN style exactly?!!
I would imagine he means that it functions like MSDN
Nader Elshehabi wrote: Also what Xml input will you give it to the program?
The XML that Visual Studio creates if you complile the assembly with the Produce XML Documentation project setting turned on.
|
|
|
|
|
I'm looking for something like JavaDoc in java.
Lets say you wrote a new class and you used the XML to write the API (or interface) of your class - all the public members of the class, and what do they do (so user will be able to use your class with ease).
in Java has JavaDoc.exe file that generate an HTML containing all that information from the source file itself.
since c# get only output XML I guess that there is a program that transforms the XML into an HTML (so it will, eventually, do the same as JavaDoc).
And by writing MSDN style, I meant HTML that looks like the MSDN APIs on the MSDN website.
hope it makes things a bit clearer
|
|
|
|