|
can you please explain me bit more...
from where i should inherit and what functionality(property) should be there so the resizing part can be done easily ...
vikas da
|
|
|
|
|
.......................................................................
. .
. .
. .
. .
. .
. .
. .
. |--------------------------| .
. | pannel1 | .
. |--------------------------| .
. |--------------------------| .
. | pannel2 | .
. |--------------------------| .
. | pannel3 | .
. |--------------------------| .
. .
. .
. .
. .
.......................................................................
so in above if i am saying panel1.hide so panel2 and panel3 should be on the place of panel1 and panel2 respectively
i want to solve this one .. please help me ...
vikas da
|
|
|
|
|
Hi,
What is the reason why you want to place those panels in one form and not creating 3 different forms? Is it you want to reuse the method, function and properties of form you've created and you don't want to repeat this codes in other form plus they have the same look and feel with some slight differences in Pane1, Panel 2 and Panel3. If your answer is YES you should go to inherited form.
NOTE: Methods and Properties of Parent Form are visible to inherited Form (Only Public and Protected access modifiers).
Parent Form
.......................................................................
. .
. .
. |--------------------------| .
. | Static Design | .
. |--------------------------|
. .
. .
. .
. |--------------------------| .
. | Area for | .
. | Other Panel | .
. |--------------------------| .
. .
. .
. .
. .
.......................................................................
Inherited Form
Locked Static Design means you can only edited this on Parent Form.
.......................................................................
. .
. .
. |--------------------------| .
. | Locked - Static Design | .
. |--------------------------|
. .
. .
. .
. |--------------------------| .
. | Area for | .
. | Other Panel | .
. |--------------------------| .
. .
. .
. .
. .
.......................................................................
The result of this approach is you have 4 Forms but you never repeated any codes that already created in Parent Form and you have more manageable codes.
To create inherited form you should go to usual process of adding new forms in the project but now you will select the object Inherited form then follow the wizard
|
|
|
|
|
No need for resizing, treat inherited forms as a new form with extra codes and design.
|
|
|
|
|
Hi
I want to develop a viso link line control. That can be attach with any shape and it has some mid points from them we can adjust its path.
Any idea, code sample or relavent article is welcomed.
Thanks
Syed Shahid Hussain
|
|
|
|
|
You mean a control that works like Visio and creates such diagrams ? You'd probably create a family of controls and write code that draws them all using a base class, I would think.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
yes I've the idea but where to start.
Syed Shahid Hussain
|
|
|
|
|
Create a base class Shape that contains width,height,x, and y. Inherit your shapes from the base class and each shape should know how to paint or draw themselves.
Create another class such as handle or nodes that is assigned to your shapes. This class will resize your shapes while dragging the handles
|
|
|
|
|
Hi All,
i have these strings: C:\CCCRM\CCCRM\bin\release\cccrmNeeded.dll. how can i take the "cccrm_Needed" out of this string. i have this code here:
char[] delimiterChar = { ':', '\\', '.' };
string[] module = file.Split(delimiterChar);
foreach (string str1 in module)
{
// To grab the needed string, which is "cccrm_Needed"
}
Many thanks
Andie
|
|
|
|
|
Path.GetFileNameWithoutExtension(yourstring)
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
Thanks a lot Christian, you are the legend.
cheers
|
|
|
|
|
I knew there had to be a better way and it would present itself eventually.
I've just never had need of the Path class before (or didn't know I did).
The FileInfo class really ought to have this member as well.
|
|
|
|
|
string myPathString = "C:\CCCRM\CCCRM\bin\release\cccrmNeeded.dll";
string fileName = System.IO.Path.GetFileName(myPathString);
"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." - Jason Jystad, 10/26/2001
|
|
|
|
|
instead for using the split function you can directly use the Path class of IO
sample code is
System.IO.Path.GetFileNameWithoutExtension (@"C:\CCCRM\CCCRM\bin\release\cccrmNeeded.dll");
and this will return the cccrmNeeded.
|
|
|
|
|
I need to Disable the button "One Page", "Two Page" shown at the top of the PrintPreview Control in the PrintPreviewDialog.Please help me
|
|
|
|
|
hi guys, how will i convert byte array to a file, then open it.
i searched the internet, but they usually create the file first then save it to their local disk, before opening... i just want to open the file(from byte array) from virtual memory.. is it possible?
i need your help badly..
thanks guys..
|
|
|
|
|
File.WriteAllBytes creates a file. Is that what you mean ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
-spy- wrote: need your help badly..
But not badly enough to answer someone who is trying to help you ? Well, great.
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
If it's not on disk it's not a file.
Once written to disk you can use Process.Start to "open" it with its associated application. That's what I do.
|
|
|
|
|
Hi All,
This is my first post in this forum that is full of excellent information I'm so glad I found it.
I have a c# program I'm working on it opens an excell file and displayes the results in a DataGrid at the moment I have it selecting the cell with the code below.
//Set excel sheet range
exr.SheetRange = "A1:C5";
What I'm trying to make it do is select the data from cells M3, M4, E5, G5, H5, R5 then go to cell G7 and read till the last empty cell to the right of G7 then read down from G7 to the last empty cell.
Any one know how to do this?
|
|
|
|
|
Hello
Not much to say but the idea is: your problem can be solved with 2 loops (on rows and columns)
try it and reply if not succeeded.
Hope u be happy.
Syed Shahid Hussain
|
|
|
|
|
|
I'm overriding OnKeyDown in a class derived from TextBox .
The new TextBox has several functions, one of which is to only allow a valid decimal (unsigned) value to 2 decimal places. All is well and decimal places are added if necessary - unless the MaxLength is exceeded when the formatting is done in OnValidating / OnLostFocus .
I figured the easiest way would be:
If the key pressed is a number then build the final string in memory, check the length of that against MaxLength and supress the key press if it would exceed MaxLength .
The problem is getting a char or string value from any of the KeyEventArgs properties if the number pad is used. Casting or converting to char returns a, b, c ...
Any ideas?
Edit:
Temporary solution
char digit;
if (e.KeyCode >= Keys.NumPad0 && e.KeyCode <= Keys.NumPad9)
digit = Convert.ToChar(e.KeyCode - 48);
else
digit = Convert.ToChar(e.KeyCode);
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
modified on Tuesday, July 29, 2008 7:18 PM
|
|
|
|
|
A) Have you considered using a NumericUpDown rather than a TextBox?
B) Have you considered using KeyPress rather than KeyDown?
private void textBox1_KeyPress ( object sender , System.Windows.Forms.KeyPressEventArgs e )
{
char digit = e.KeyChar ;
}
|
|
|
|
|
The NumericUpDown is not an option.
I considered KeyPress but it's not raised by non character keys which could potentially screw up other functions
Thanks anyway.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
|
|
|
|