|
I am sorry for late reply, but this code does exactly as i would use resize event or setting min and max size. this.DesignMode is part of an answer and i thank you for it. I have just found a book with more advance topics. I am sure it will be there. Thank you for your time
|
|
|
|
|
I Found the way to use what i wanted.
I added a dll reference: system.Design.dll
I added using System.Windows.Form.Design
[ToolboxItem(true)]
[Designer(typeof(testDesigner))]
public class test : Button
{
[Browsable(true)]
public bool MultiLine
{
get
{
return testDesigner.m;
}
set
{
testDesigner.m = value;
}
}
}
public class testDesigner : ControlDesigner
{
public static bool m;
public override SelectionRules SelectionRules
{
get
{
if (!m)
return SelectionRules.LeftSizeable | SelectionRules.RightSizeable | SelectionRules.Visible | SelectionRules.Moveable;
else
return SelectionRules.BottomSizeable | SelectionRules.TopSizeable | SelectionRules.Visible | SelectionRules.Moveable;
}
}
}
|
|
|
|
|
|
Hi anyone, good day for you...
i have a problem of using an ICMP class at SharpPcap-2.1.1, i need example showing the implementation of that class.........
thank u, i hope u will help me .............. Is that OK ???
|
|
|
|
|
Maybe this question is better off at a forum at the providers of SharpPcap?
|
|
|
|
|
Whatever SharpPcap-2.1.1 is, doesn't comes with some documentation or help file or a website or a forum? You should be searching them since they are the dedicated source to understand SharpPcap-2.1.1.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
3bood.ghzawi wrote: ICMP
No clue what that is.
3bood.ghzawi wrote: SharpPcap-2.1.1
No clue what that is.
You definitely need some help.
There are only 10 types of people in this world — those who understand binary, and those who don't. |
|
|
|
|
|
This forum is only for the c# using the standard framework elements. If you are using a 3rd party API/ Framework you should try their forum. Few (if any) people here will have any experience of SharpPcap.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
Hi
I have a tabcontrol in my form that this tabcontrol has 7 tabpages ;
I want to know how can i hide or unvisible or disable some tabpages of this tabcontrol?
|
|
|
|
|
I found this:
You can dynamically remove and inseret TabPages into the TabControl.TabPages collection to hide and show tabs at runtime.
TabPage tabPageSave = null;
private void button1_Click(object sender, EventArgs e)
{
this.tabPageSave = tabControl1.SelectedTab;
this.tabControl1.TabPages.Remove(this.tabPageSave);
}
private void button2_Click(object sender, EventArgs e)
{
if (this.tabPageSave != null)
{
int loc = tabControl1.SelectedIndex;
this.tabControl1.TabPages.Insert(loc, this.tabPageSave);
}
}
using this google search phrase:
c# winforms tabcontrol hide tabs
Personally, I create TabItems manually instead of adding them in the designer, and then instantiate them in a List so I can manipulate them more logically, but it's essentially the same as what's happening in the code above.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Hi,
I am creating query editor as in sql server. I have to use blue color for reserved words and black for others. I have inserted the color table in "RTF" of richtextbox , but the modifications in the "RTF" cause the index of richtextbox remains at zero.
Please tell me the reason of this.
Thanks,
Sonia
|
|
|
|
|
Index? What index of RichTextBox?? Your question doesn't make any sense.
|
|
|
|
|
Dave I think what is meant by index is the index of a thing in the table or perhaps the index of paragraph etc being enumerated in the RTF.
|
|
|
|
|
Cursor remains on the start of richtextbox.
|
|
|
|
|
Adding text to the RTB, or any TextBox for that matter, does not move the Caret. The property that controls the Caret position is SelectionStart. If you want to add text and move the Caret at the same time, use AppendText, or just set the SelectionStart property yourself.
|
|
|
|
|
I originally created a project in VS2008, converted it to VS2010. Last night, I decided I didn't want to continue using VS2010.
I then created a new project in VS2008, and copied all of the code from the original project into it. Everything compiles just fine, but the app didn't work like it did before the latest conversion, so I started up a debug session, and immediately found the problem.
When the app starts up, it fires off a BackgroundWorker object. The worker processes as normal, but when it jumps into the ReportProgress event handler,the first line of code is an if statement. It appears as if the if statement isn't being evaluated at all (I put an else clause in to see, and it's not being stepped into at all), and control is immediately returned to the RunWorker event handler.
What could I have done to the code that could possibly cause this?
Of course, I've tried the obvious remedy (clean/rebuild), but it didn't work.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Have you tried writing a trace to the output window from the ReportProgress event handler? There is probably something going on with the threading possibly the debugger isn't picking up the call to the handler due to a different thread being used.
I think it likely that VS2010 uses a different thread model to VS2008, being built using WPF, you might even have discovered a genuine bug in the VS2010 beta...
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
|
|
|
|
|
I've only seen this kind of thing when the debug data gets "out of sync" with the source code, and it is usually resolved by doing a re-build. However, if the project is in Release Configuration rather than Debug Configuration, then optimizations in the build could be causing it to skip the code. The thing is, it usually only skips code that it determines will never be executed. I would ensure that you are working in Debug Configuration and check the values that the if statement tests as soon as it enters the event handler. If you think the compiler is errantly determining that statement to be unnecessary and optimizing it out; stick "true && " at the front of it to force the statement to resolve to true and then re-build and re-run the code.
Hold on a second here... Don't you think you might be putting the horse ahead of the cart?
|
|
|
|
|
true || ?
|
|
|
|
|
Yes, what was I thinking!!
See, I was just checking to make sure the rest of you are on your toes!
Hold on a second here... Don't you think you might be putting the horse ahead of the cart?
|
|
|
|
|
Well, it's a completely new project created in VS2008, and I only added the source files back to the project. I know for a fact there aren't any PCB files or other temporary files form VS2010 because of the way the project was created, so I'm not sure how the debug info can be out of sync.
I also verified that the project is indeed being compiled in debug mode.
The if statement isn't evaluated at all. The debugger hits that statement, and then goes right back to the runworker event handler. I suspect that putting true || in front of the existing expression wouldn't have any effect, but when I get home, I'll try it.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
Did you manipulate the BackgroundWorker through the designer in VS2010? If so, it may have added some funky code to the .designer.cs file. Just a thought...
Hold on a second here... Don't you think you might be putting the horse ahead of the cart?
|
|
|
|
|
Nope - manually added.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|
|
I've read your OP properly and understand that you've take a project back to VS2008 .
The PDB sync is the first problem that I've encountered that might cause your error. I've had problems with clean in the past, and had to manually clear out all the BIN directories. I'd go to the extent of deleting all build "flavour" directories (bin\debug \bin\live etc). This has two effects: The PDB must be in sync; and, as has happened to me in the past, a Solution "debug" build had "live" builds hidden away in the the Configuration Manager. If you do a debug build and have anything other than debug sub-directories in your bin folder, this might be your culprit.
The only other time I've seen this problem was when an exception was raised on another thread (the UI thread in my case), and a top level exception handler caught it without reporting. To find this, switch on break on all exceptions.
CCC solved so far: 2 (including a Hard One!)
37!?!! - Randall, Clerks
modified on Tuesday, December 29, 2009 10:00 AM
|
|
|
|
|
You didn't read the whole message. I created a BRAND NEW project in VS2008 and moved the source code to it, and re-added the appropriate references to the new project. There were no PDB files brought over, and certainly no project files.
As far as it knows, it began life as a VS2008 project.
.45 ACP - because shooting twice is just silly ----- "Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "The staggering layers of obscenity in your statement make it a work of art on so many levels." - J. Jystad, 2001
|
|
|
|