|
Hi
I have SplitContainer with two panels where in one panel there are many controls. During Resize event I would like all controls in the panel be resized too. Is there any way to do that automatically (any property) or should I do it by counting the size of each control depending on size of panel? (for me not a good solution).
Thanks for help
Ela
|
|
|
|
|
|
You could try to do an Anchor left, top, right. However all controls in your panel must be in a single collumn for this to work correctly.
What you may have to do if Anchoring does not help is to subscribe to the Resize event on the panel. Then based on the size of Panel1 or Panel2 (whichever side your controls are in) you set the new sizes of your controls. I found one or two situations where Anchoring just did not do it for all of my controls.
|
|
|
|
|
Thanks for the answers. Anchoring is not a good solution. Controls are not resized. I have to do what I was affraid of. I will have to count the size of cotrols depends on size of panel.
Thanks
Ela
|
|
|
|
|
Hi,
In my Java course as part of my degree we did class relationships based on the UML diagram. I would like to implement this same technique with C#.
If I create a Customer and Order class, how can I implement a class relation in code?
Is this the correct way to go in C#, or how is this technique implemented in C#? If any one has any good articles on this, please let me know.
Regards,
ma se
|
|
|
|
|
ma se wrote: If I create a Customer and Order class, how can I implement a class relation in code?
More or less the same way you would with Java. Most likely, you will have an instance of a Customer class which holds a list (or collection) of Order class instances.
The .NET 1.x way was to create a typed Collection (OrderCollection), but .NET 2.x introduced Generics which negate the need to do so. Start with your Customer class and go from there!
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
At the IDE level, if you had unlimited funds you could get Visual Studio Team Developer (or is it Team Architect??). From within here you can construct a UML class diagram and spin out the base classes and methods that support the diagram.
The nice part of this is when you make changes in your code, they are reflected in the class diagram. But the expense is out there.
Now with your class definitions your would just have something like this:
public class Customer
{
private Orders orders;
public Orders OrderInformation
{
get{ return orders; }
set{ orders = value; }
}
}
public class Orders : List%lt;Order%gt;{}
public class Order
{
}
-- modified at 14:28 Thursday 29th June, 2006
|
|
|
|
|
Hi to all,
How can I add code to User Control Unload Event? ( Code at time of Form Close in UserControl Code).
What is the use of RowHeader in DataGridView? Can I show index automatically to each row?
How Can I validate a path of a file?
Thanks & Best Regrads,
Aniket Salunkhe
|
|
|
|
|
what do you mean by validating the path of a file?
Check if it contains "valid" characters? use regexp.
If you wan't to check if the folder specified exist use: System.IO.Directory.Exists(folder)
If you wan't to check if the file exists use:
System.IO.File.Exists(file)
You will have to explain a little bit more for me what you mean by your first question. Every form has a FormClosing event, maybe you could use it to trigger other events/methods to do your work...
|
|
|
|
|
Hi,
I have designed an User Control having 'DataGridView' in it, which uses XML-File to show data in grid.
But I want to Write the XML-File (changes made in grid ) when application closes.
How to do that? What event should I use for that in the 'User Control '? Is there any Unload event for User Control?
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
ok, so what if you make a function in your control, let's call it SaveStructure()
In your mainform/mainwindows/mainapplication you add this code to FormClosing event:
MyFancyInstanceOfMyObject.SaveStructure();
done ...
To be honest I don't know(I don't think there is an UnLoad event for user-controls by standard). But this should work anyway...
|
|
|
|
|
Hi,
Thanks.
Same think I have done. I thought that I am missing some thing. But if you have another solution for my User Control just tell me.
Also I have another query...
What is the use of RowHeader in DataGridView? Can I add a column (1st column) such that it will show index (automatically increasing/decreasing) of each row? i.e. same as Numbering done in Word Document
Thanks & Best Regards,
Aniket Salunkhe
|
|
|
|
|
Hello,
I have a problem with DataTable.
I read records by Stored Procedure and I put records in MyDataTable.
My DataGridView.DataSource = MyDataTable;
When I click "Next Record" button, the property
of
MyDataTable.Rows[this.BindingContext[dtNominativi].Position].RowState
become Modified, but I haven't modified filed.
WHY????
HELP ME PLEASE!!!!!
|
|
|
|
|
BindingContext is reactive to you location in the table, so by clicking next you are modifing it.
Why where you hoping for it not to be changed?
|
|
|
|
|
Hi,
Can anyone tell me how to send images in the mail. Not as a attachment, I want to embed images in the mail.
Thanks,
Sushant Duggal.
|
|
|
|
|
If you use Outlook automation to send the mails, just insert the attachement at a position in (not after) the text:
outlookItem.Attachments.Add(
fileName,
OlAttachmentType.olByValue,
newItem.Body.Length+1,
fileNameWithoutPath);
If you don't send the mails in an Outlook/Exchange environment, I suggest you forget it, because most email clients won't display the attachment inline unless you format a proper HTML email body with image tags referencing the attachments.
|
|
|
|
|
HI,
Do you know how to get or from where to get an editor like the one provided in Microsoft Outlook?
I'll be greatful for for help.
Thanks,
Sushant Duggal.
|
|
|
|
|
Hi
<br />
Form frm = new Form()<br />
frm.Cursor = new Cursor(filename);<br />
Works fine if you have a form and the mouse cursor is over the form.
I would like to get at the default mouse cursor so that I can change the pointer even if there is no form.
Cheers
Si
|
|
|
|
|
I'll explain further as nobody has replied
I'm writing a server app' that is started from a scheduled task, it requires no gui as the config file contains everything it needs to start and another app feeds it with data.
I'd like something to show the application is running on the server so that people don't think the computer needs rebooting due to laggyness (if there is such a word).
I have made an animated cursor that could be used to show this application is running.
The only method of showing it I know of requires the application to have a form and the mouse cursor to be within its area.
Please help if you can.
|
|
|
|
|
That might prove a bit trickier than anticipated. There might be no users logged in when the application starts, or there may be several. You would also have to monitor the users so that anyone logging in after the application started gets the custom cursor.
I suggest that you instead write a small monitor application that shows when the server application is running. You can put it as an icon in the system tray.
---
b { font-weight: normal; }
|
|
|
|
|
Good point, if I hooked the user32.dll it'd be current user presumably.
I had considered systray but thought it could be easily overlooked. I suppose I could use alternating bright colours to draw the eye...
cheers
|
|
|
|
|
What is it that you are trying to accomplish, really? Who is going to monitor the appplication, and why?
If you change the default cursor, that could easily be overlooked too. The pointer could be at the edge of the screen. The pointer can be set to be hidden while typing.
---
b { font-weight: normal; }
|
|
|
|
|
Good question, in actuallity I'm probably more determined to change the cursor in this manner because I'm quite pleased with the animation I've created.
|
|
|
|
|
Can't you use the animation as an icon in the system tray?
---
b { font-weight: normal; }
|
|
|
|
|
Yeah, i've settled for SysTray but i'm having this problem now
|
|
|
|