Hi, I was thinking about Anchor property as well. How about using a SplitContainer in a horizontal oritation, with two textBoxes Dock property set as Fill? Br!" Sun
Lyon Sun
Posts
-
How to resize two texbox proportionally? -
change TableLayoutPanel RowCount before Custom Control Initialization?Hi, all, In WinForms with C#, a TableLayoutPanel custom control with, saying, 10 rows and 5 columns being designed in designer window.
NumberOfRows
was coded as a property of this custom control. I wish to change this property value and set it as a new RowCount of the TableLayoutPanel mentioned above, before the custom control runningInitializeComponent()
. Is this possible? I have tried to do it with a method in the SET of that property as below:private void OnNumberOfRowsChanged()
{
tableLayoutPanel1.RowCount = numberOfRows;
}and it didn't work while I change the value of
NumberOfRows
property, and set a breakpoint in the constructor method of that custom control, the RowCount remains as 10. Btw, I tried to usetableLayoutPanel1.RowStyles.Remove()
andtableLayoutPanel1.RowStyles.RemoveAt(index)
as well, neither of these two works as well... Any Idea? Your kind help is so much appreciated!! Br! Sun -
problem with custom control properties valueHi, stancrm, You are right. I did this exception in the wrong place, and with a wrong exception name as well :rolleyes: . I noticed it after I read Sur's reply. Anyway, Thank you two!! A lot! Br! Sun
-
problem with custom control properties valueHi, Sur, Thank you so much! This solved my problem. Really, thanks a lot!! Br! Sun
-
problem with custom control properties valuethank you, stancrm, I've tried this, I added one method,
OnCurrentLineChanged()
in the SET of that property, and the method is as follows:private void OnCurrentLineChanged() { if (currentLine < 1 || currentLine > 100) { throw new System.ArgumentException("Property value is not valid", "original"); } }
However, I don't know for what reason, it doesn't work when I go designer window and try a number like 123. Any idea with this? Br! Sun
-
problem with custom control properties valueHi, all, I am doing with a custom control in WinForms, and there is one customed integer type property, say,
currentLine
, declared in that custom control class with the following code:private int currentLine; public int CurrentLine { get { return currentLine; } set { currentLine = value; } }
but this property's value should be restricted between 1 and 100. How to make this happen, so that a value smaller than 1, or bigger than 100 is rejected to be entered in properties window at designer time? Any suggestions are so much appreciated!! Thanks. Br! Sun
-
Form flickering problemLuc Pattyn wrote:
assuming the button is visible on some form,
Hi, what if I create this button btn_OK dynamically in my codes then? Thanks for your patient so much! ;) Sun
-
Form flickering problemLuc Pattyn wrote:
IMO this.Dispose() does not make any sense,
Hi, Sorry if I said it wrong, but when I mentioned
this.Dispose()
,this
= the main form. But thank you, Luc, I got your point. Again, I have another question, what if I set a new Font for one control, for example, btn_OK, am I doing it rightly by the code below:btn_OK.Font = new Font(....);
...
btn_OK.Font.Dispose();Thanks in advance!;) Sun
-
Form flickering problemLuc Pattyn wrote:
if you have those, don't forget to Dispose the ones you created
Hi, What if my app has values need to be passed? does
this.Dispose()
going to erase them? Sun -
While MouseDownZap-Man wrote:
private static bool IsKeyDown = false;
Confused. Can this variable be changed ever? Correct me if I am wrong...:)
-
Visual Studio 2005 C# versionHi, I guess it's .NET 2.0, since you can see it's combined with Visual Studio 2005, well, for example, look at the right side of this page[]. :)
-
tab appearance in c#Interesting. Do you mean you don't need so many tabs? Cuz, first, when one tab is showing, the others are hiding; second, tab pages can be removed if not needed. ;)
-
WMPHuh, Sorry, I must have read your previous post wrong.:) If you need free source of that book, you can just google the name of that book with keyword "rapidshare", then you should have few links to be accessed. Good luck! Sun
-
WMPYonathan1111 wrote:
Hi leapsword, I need free source.
Hi, Free source are certainly not possible to be given, cuz: 1. They require other people's hard work on; 2. We are here only for the reason to try to help each other with problems, but not for the sake of giving a solution; So, very sorry to say, but you probably need to go and buy a book to read, or do some research by searching on internet. ;)
-
landscape page in crystal reportAnd I just want to have a million dollars. :laugh:
-
Get Control information at Mouse Position?:omg: Okay, you mean this. Thank you anyway!
-
Get Control information at Mouse Position?Hi, Thank you for your replying! ;)
Luc Pattyn wrote:
One handler can contain code that causes many new events to fire (i.e. be added to the queue), e.g. by executing btn.PerformClick().
Could you be so kind to explain little bit more details about this line? Your kind help is so much appreciated! Sun
-
WMPHi, You might be able to get some ideas if you could go through Chapter 16 of this book :laugh: Best wishes!
-
Get Control information at Mouse Position?Hi, all, Suppose I have two buttons in my WinForms Application, named as
btn_First
,btn_Second
, Is it possible to do the following steps: 1. FireMouse_Down
event ofbtn_First
, 2.Mouse_Leave
frombtn_First
, 3. while Mouse Event ofbtn_Second
is still not released yet,Mouse_Enter
intobtn_Second
get fired, and then, get the information such like(Control)sender
isbtn_Second
, etc?? According to what I have learned so far, I think this is not possible, because two events are not supposed to get fired at the same time. But I am not so sure, just wanna ensure this(hope this is not so stupid a question ;P ). Thank you. Any suggestions would be so much appreciated! -
Problem with RichText Box(Right Click Cut/Copy/Paste/SelectAll)...As d@nish said below, that is 100% possible. You just have to set the ContextMenuStrip Property for those two of your RichTextBoxes, enjoying the coding time. :laugh: