|
Hi, Im relativlly new to C#, so I dont really know what to look for.
THe method aparently works just fine and is "error-less" becouse when I compiled the plugin the compiller didn't return me any warnings or errors.
THe ExecutePlugin inside the plugin looksliek this:
public void ExecutePlugin ( string Commands )
{
MessageBox.Show ( Commands, PluginName );
}
and liek I said I cen get the PluginName property inside my main programm, but the messagebox dosen't show ...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
I am just starting out with C# and want to know how can I tell what kinda of project the code was started from by looking at the code. and by project I mean when you create a new project, from the wizard....
Thanks
Ralph
|
|
|
|
|
Mostly, look at the class that's generated. If it extends System.Windows.Forms.Form , is most likely a Windows Forms property. If it inherits from System.Windows.Forms.UserControl is a user control project. If it just includes a static Main method and not much else, it's probably a console application. If you have a bunch of web forms (.aspx files) then you've got a web project. The best thing you can do is just start playing around with the different types and see what's generated, as well as read some of the articles in the .NET Framework SDK. There's also samples and tutorials out there.
Also, don't forget that CodeProject is a great resource and has many articles that often go in-depth into the technologies they target such as Windows Forms or ASP.NET.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have to change my report at runtime
how to I can do it?
(I use CrystalReport 9)
please help me.
|
|
|
|
|
Define "change". If you mean change the layout, the ReportDocument has a property, ReportDefinition , that gets you the collection of sections, etc. I'm not sure how much of this you can change at runtime, but you might be better off asking in the Crystal Reports forums at http://support.businessobjects.com/forums/default.asp?ref=devzone_main[^].
If you mean to change the data source on which to report, see the ReportDocument.SetDataSource method. Designing your reports to use disconnected DataSet objects (especially strongly-typed ones that you can build report defintions from) makes reusing your reports on different systems and with different database easy!
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi
We have an MDI application, where we would like to limit the possible locations of the MDI child forms.
Is it possible to set up some kind of borders that limit child location to some part of the client area?
Currently we simply move the form back inside the borders if it dragged outside of the borders. Unfortunately, this has some sideeffects (e.g. client form can be moved far outside the borders before the moved event is raised)
BTW: Is it possible to disable the scroll bars that appears on a MDI parent?
Thanks, Mads
|
|
|
|
|
Yes, you can fix the Child form location MDI form.
You have to set the following properties in Child form
Form Location
Form Border = none
Control box= false
MaxBotton=false
MinBotton=false
Window Startup position=normal
Regards,
Amal
amal_forum@hotmail.com
|
|
|
|
|
Thanks for your reply - but wouldn't that make the form unmoveable? What we want is to be able to move the form around within a limited area.
|
|
|
|
|
You can set the child form boundry in Child form MOVE event.
Regards,
Amal
amal_forum@hotmail.com
|
|
|
|
|
Hi, I want to ask if there is in .NET an similar technology to the Java Applet/Servlet. And if such a thing exists pls help me with some documentation resources.
Thanks a lot.
|
|
|
|
|
refer the following URLs
www.gotdotnet.com/team/compare
http://java.oreilly.com/news/farley_0800.html
Regards,
Amal
amal_forum@hotmail.com
|
|
|
|
|
I wrote an article a long time back on another site that I'm working on porting to CodeProject as a new series. See http://www.devhood.com/Tutorials/tutorial_details.aspx?tutorial_id=388[^] for more information about hosting .NET controls in a web page. If exposed as COM control correctly (which the articles covers), you can even script them and handle events.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
How to read the current selected or clicked grid cell value as well as the whole row to which that cell belongs ?
Appreciate your help.
MSG: Life is whole learning experience.
|
|
|
|
|
Overriden CurentCellChanged event or :
dg[dg.CurrentCell.RowNumber,dg.CurrentCell.ColumnNumber]
Mazy
No sig. available now.
|
|
|
|
|
Thanks, Got it ..
Here it's:
.
.
MessageBox.Show((datagridBrowse[i,j])ToString());
.
.
Many Thanks 44.
Life is whole learning experience..
|
|
|
|
|
hi
i am currently writing an application where the user can save as much as he wants
those are splitted in A[] and B[] (String[])
a contains A name and B contains a path related to the name of A
i want that A will be shown in a listbox (all A's) and when you click on it i want a messagebox showing A and B together (the right one, e.g. A[5] and B[5]; not A[4] and B[2] or so)
i am open for all ways of saving, but i do not have an own idea how i can make this
thx
|
|
|
|
|
You can create a serialize class and encapsualte your class there and store your data in a XML file,for working with XML there are lots of projects in this site. Or if you do not want to store it in a XML,you can store that class in dat file.
Mazy
No sig. available now.
|
|
|
|
|
1) You can use a ListView instead of the ListBox, and store the path (B) in the .Tag property of each ListViewEntry. When you click a name (A), you can read the path from the Tag property:
for(int n=0; n
|
|
|
|
|
I have a windows application which has a lot of controls placed all over the screen. I have developed it in screen resolution of 1024 X 768.
The problem is that when the resolution becomes more, the controls occupy lesser space on the screen with lot of free area. If the resolution decreases, each control requires more space on the screen and many controls go out of the screen with scroll bars being displayed.
Is there a way of dynamically resizing the form controls based on the resolution of Windows?
Koos
|
|
|
|
|
First: There are many applications that they fir for one resolution and warn it before run. But beyond that after your InitializeComponent() add a method that set the methods based on this resolution. You can get the resolution with SystemInformation.VirtualScreen property,and every control has its own Size property.
Mazy
No sig. available now.
|
|
|
|
|
In addition to what Mazdak was talking about, you can also make use of the Dock property that most of the controls expose. Effective docking can help decrease those problems. If you're not starting with a clean surface, though, pay close attention to the order in which controls are added to the container's (ex: Form ) Controls collectoin. They must be added in reverse order. For instance, if you have the "explorer layout" like so:
+-+---+
| | |
| | |
+-+---+ , you'll want a TreeView , Panel (to further dock additional controls), or some other control set to <cod>DockStyle.Left, then a splitter, then another control with DockStyle.Fill . The order in which these are added are in reverse of how I mentioned them:
Controls.AddRange(new Control[]
{
panel2,
splitter1,
panel1
}); When you add these controls to the designer for the first time (i.e., on a "clean surface"), add them in the order that I first mentioned above. VS.NET automatically adds the most recently added control as the first control in the array above.
Just play around with docking a little bit. Anchoring to opposing sides is also helpful but while docking and anchoring share some behavior in common, they are also used to solve distinct problems (they are most like each other when anchoring against opposing and adjacent sides, but docking can't move a control relative to adjacent sides).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
DockStyle in IMO is the easy way out, if you want control, use anchors.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|
|
The problem with anchors is that theyonly anchor to the parent control/form, and when the control/form shrinks the controls overlap.
The problem with docking is that the change in size is only shown in the fill'd control, and there is only one of these.
What you want is to have the control container resize the child controls, for that you need to create an "AutoSizePanel", have that dock'd fill and then set your controls on the panel.
Here is the code for the "AutoSizePanel":
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;
namespace Workbench
{
/// <summary>
/// A panel that resizes controls automatically.
/// </summary>
public class AutoSizePanel : Panel
{
/// <summary>
/// Holds the control info.
/// </summary>
private Hashtable htInfo = new Hashtable();
/// <summary>
/// Flag to prevent recursive call.
/// </summary>
private bool bAllowResize = true;
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.Container components = null;
/// <summary>
/// Constructor.
/// </summary>
public AutoSizePanel()
{
InitializeComponent();
}
/// <summary>
/// Adds a control to the list of controls.
/// </summary>
/// <param name="e"></param>
protected override void OnControlAdded(ControlEventArgs e)
{
// Hold the resizing
bAllowResize = false;
// Create the original info
SizingInfo riData = new SizingInfo(e.Control);
// Add to table
htInfo.Add(e.Control, riData);
// BAck to normal
bAllowResize = true;
//
base.OnControlAdded (e);
}
/// <summary>
/// Removes a control from the list of controls.
/// </summary>
/// <param name="e"></param>
protected override void OnControlRemoved(ControlEventArgs e)
{
// Delete the info
htInfo.Remove(e.Control);
//
base.OnControlRemoved (e);
}
/// <summary>
/// Does the magic.
/// </summary>
/// <param name="e"></param>
protected override void OnResize(EventArgs e)
{
// Only once
if (bAllowResize)
{
// Set
bAllowResize = false;
// And apply to each control
foreach (Control ctl in this.Controls)
{
// Get the original info
SizingInfo riCtl = htInfo[ctl] as SizingInfo;
// Info available?
if (riCtl != null)
{
// Resize
riCtl.Resize(ctl);
}
}
// Reset
bAllowResize = true;
}
//
base.OnResize (e);
}
protected override void OnPaint(PaintEventArgs e)
{
// Hold the resizing
bAllowResize = false;
// Collect info
foreach (Control ctl in this.Controls)
{
// Get the original info
SizingInfo riCtl = htInfo[ctl] as SizingInfo;
// Info available?
if (riCtl != null)
{
// Update
riCtl.Update(ctl);
}
}
// Back to normal
bAllowResize = true;
//
base.OnPaint (e);
}
/// <summary>
/// Clean up any resources being used.
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if(components != null)
{
components.Dispose();
}
}
base.Dispose( disposing );
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
//
// AutoSizePanel
//
this.Name = "AutoSizePanel";
this.Size = new System.Drawing.Size(232, 184);
}
#endregion
/// <summary>
/// This holds the original control information.
/// </summary>
private class SizingInfo
{
/// <summary>
/// Info to be kept.
/// </summary>
public int iTop;
public int iLeft;
public int iHeight;
public int iWidth;
public int iParentHeight;
public int iParentWidth;
/// <summary>
/// Constructor
/// </summary>
/// <param name="ctl"></param>
public SizingInfo(Control ctl)
{
// Save
this.Initialize(ctl);
}
/// <summary>
/// Updates the internal info
/// </summary>
/// <param name="ctl"></param>
public void Update(Control ctl)
{
// Compute the change.
double dRatioHeight = (double) ctl.Parent.Height / iParentHeight;
double dRatioWidth = (double) ctl.Parent.Width / iParentWidth;
// And where it would go.
int iWTop = (int) (iTop * dRatioHeight);
int iWHeight = (int) (iHeight * dRatioHeight);
int iWLeft = (int) (iLeft * dRatioWidth);
int iWWidth = (int) (iWidth * dRatioWidth);
// Changes?
if ((iWTop != ctl.Top) || (iWLeft != ctl.Left) || (iWHeight != ctl.Height) || (iWWidth != ctl.Width))
{
// Reset
this.Initialize(ctl);
}
}
/// <summary>
/// Does the magic
/// </summary>
/// <param name="ctl"></param>
public void Resize(Control ctl)
{
// Compute the change.
double dRatioHeight = (double) ctl.Parent.Height / iParentHeight;
double dRatioWidth = (double) ctl.Parent.Width / iParentWidth;
// And shake it
ctl.Top = (int) (iTop * dRatioHeight);
ctl.Height = (int) (iHeight * dRatioHeight);
ctl.Left = (int) (iLeft * dRatioWidth);
ctl.Width = (int) (iWidth * dRatioWidth);
}
/// <summary>
/// Saves the base info
/// </summary>
/// <param name="ctl"></param>
private void Initialize(Control ctl)
{
// Save
iTop = ctl.Top;
iLeft = ctl.Left;
iHeight = ctl.Height;
iWidth = ctl.Width;
iParentHeight = ctl.Parent.Height;
iParentWidth = ctl.Parent.Width;
}
}
}
}
This code is being made available to all freely.... Have fun, but do not copyright.
|
|
|
|
|
je_gonzalez wrote:
The problem with anchors is that theyonly anchor to the parent control/form, and when the control/form shrinks the controls overlap.
Hopefully at that stage the user realises that his an idiot, and the app wont run at 20 x 40 px.
leppie::AllocCPArticle("Zee blog"); Seen on my Campus BBS: Linux is free...coz no-one wants to pay for it.
|
|
|
|