|
Or simply release the crack, it might generate more interest
|
|
|
|
|
IMHO hanging unauthorized users is too severe.
|
|
|
|
|
I have a windows form of some size say (519, 118)
now i have three pannels there somewhere in the center of the form..
now at run time i want to make some pannel invisible
so how can i resize the form so that it form looks good ..means the space that was dedicated for pannel 1 is removed at run time
Thank you ver much
vikas da
|
|
|
|
|
your panel are in horizontal layout or verticle, what ever be change the logic accordingly
set two properties Location and size
First
location Point (0,0)
size(form.width,form.height/2)
second
location Point (0,form.height/2)
size(form.width,form.height/2)
That's it. (According to my perception)
Be happy
Syed Shahid Hussain
|
|
|
|
|
first of all sorry i was away from my system...
it is not just a pannel on the form i am having grid and some button also...
the pannels are just below the grid and above to buttons ... i was trying to dock the pannel but no luck coz it is neither top nor bottom or verticle ..
thank you very much for ur help ... i am sorry i didnt clear all these points earlier ...
vikas da
|
|
|
|
|
panel3.Visible = false;
this.Size = new Size(this.Height - panel3.Height , this.Width);
i am assuming all three panel are in vertically arranged and panel 3 is the last panel.
or
to make the load of the form as per available controls you can write the resize event of the form.
|
|
|
|
|
Thank you very much for ur reply ... all pannels are horigental let me try with this solution ..
i will do like
panel3.Visible = false;
this.Size = new Size(this.Height , this.Width- panel3.Width);
vikas da
|
|
|
|
|
Hi,
Instead of hiding and resizing the other panel use INHERITED FORM. This approach is better because it uses OOP when designing Windows forms. This concept is similar with MASTER PAGE of ASP.NET.
Regards,
|
|
|
|
|
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.
|
|
|
|