|
bfis108137 wrote: The order is predetermined. I cannot play with it
The order is not for you to play with, it's for the user to add, remove, rearrange.
bfis108137 wrote: Also could I do it the easy way and then somehow use the code later in the new format
Yes you can redo the system later on, it will just bite you back in the end, hard. But because now that you have a working application, the user will not want you to redo it because of time and effort, unless you have a really really good reason.
I have seen application that started with "keep it simple cos we want the system as soon as possible" requirement from user and eventually it expanded until the original (non)design became a obstacle for the expansion.
Anyway we are not forcing you to do it certain way. You should present the options to the user/owner about the effort needed and the flexibilities. If they still want the "simple way", let them know that maintaining it later will cost them more.
|
|
|
|
|
Does anyone have any coded c# examples of how this would be implemented?? and once again you guys are suggesting that I store my controls in a database basically right??
|
|
|
|
|
Hi, my reply, three up right now, works fine without a database. It uses what I would call "forms in forms".
|
|
|
|
|
What if I created a standard panel size that would be big enough to fit any 1 question into it, and I stored the panels in a collection, and then serialized the collection. Would the panels in the collection hold all the controls within it, or would it just hold the panel?
|
|
|
|
|
Hi,
if this is as a response to my earlier suggestion (with Form.TopLevel set false), then:
1. why serialize things, I never mentioned that.
2. I'm not a serializing expert, but I don't expect the Collection of Panels to automatically
keep all its Panel contents.
3. a Control (such as a Panel or a Form) that holds other Controls, can be included inside another
Control (such as a Panel or a Form), and by doing so it remains the parent of all the Controls it
was holding; basically you can build Control hierarchies the same way you build file/folder
hierarchies in a file system.
|
|
|
|
|
Hope someone can help. My problem is that the appearance of the buttons is different when I launch the application after I do a Windows Install. When executing from Visual Studio, the individual buttons are not shown. After installing from an msi file (both on my and other computers), the GUI changes. When I start the application from the installed map (c://programFiles), the buttons are changed. I know that this is not caused by any of the dlls in the install map (since I copied them from my own map by hand to test this). When I changed the name of the application in the install map (c://programFiles) then the buttons look as they should. So, there must be some connection between some data base and the application which causes this to happen (and this connection is somehow dependent on the original name of the application). How, can I prevent this from happening? Is this some sort of a bug in VS? Vista?
I am using VS 2005 for .net on Vista, working with Windows Forms, and using C#.
Have been surfing the net like a madman to no avail so Any ideas? anyone?
Katalin
|
|
|
|
|
Welcome to Code Project
Katalin21 wrote: So, there must be some connection between some data base and the application
A Database? No, the only connection to a Database would be one the developers created. Nothing in Windows or .NET or Windows Installer is going to generate some undesired-unknown connection to a Database the developers are not even aware of, period.
Katalin21 wrote: When I changed the name of the application in the install map
I am not familiar with the term "install map" and a google search is not finding it either. Are you making that up? Don't make up your own terminology for posting in forums, people will not understand what you are talking about. Read and study the technology you are working with so you can use the terminology that people will understand.
led mike
|
|
|
|
|
Hi again,
What I meant by "install map" is the place to which the msi file will install the application. In most cases (as in mine) the default is usually to the "Program Files" map. And no I don't know for sure that there is some sort of connection between the name of the installed application and some sort of install data base (possibly the msi file) but that seems like a logical conclusion since the application behaves as it should when I change its name in the map where it installs under c://program files.
My question is: how do I prevent this behaviour (the changed appearance of the buttons) since it would not be reasonable to ask the user to change the name of the application after installation?
Best Regards,
Katalin
|
|
|
|
|
Katalin21 wrote: What I meant by "install map" is the place to which the msi file will install the application. In most cases (as in mine) the default is usually to the "Program Files" map.
folder . That's the word you are substituting with "map". Program Files is a folder , not a map.
Katalin21 wrote: there is some sort of connection between the name of the installed application and some sort of install data base (possibly the msi file)
Well an MSI file is a database, but no your application has no "connection" to it. Unless of course you are not talking about a Database Connection[^] and we are having a terminology communications problem like with folder and map. The Windows Installer runtime uses the MSI database to perform the installation.
Also what do you mean by the "name of the installed application"? Are you talking about the executable file name? MyApplication.exe
led mike
|
|
|
|
|
Yes, if, for example the installed application were to be called "MyApplication.exe", then the name of the installed application would be "MyApplication".
When I change that name to "MyApp" in the folder: "Program Files", which is the place where it got installed then, the appearance of the buttons is as it should be - as it is when I execute the application from inside VS. So, my question is: What do I have to do to insure that the GUI does not change in the installed version.
Regards,
Katalin
|
|
|
|
|
Katalin21 wrote: When I change that name to "MyApp" in the folder: "Program Files", which is the place where it got installed then, the appearance of the buttons is as it should be
What happens if after that, you change it back?
Also in your first post you said the same about the "appearance" of the buttons but also said this:
Katalin21 wrote: When executing from Visual Studio, the individual buttons are not shown.
So could you clarify that and also clarify what is different about the "appearance"?
led mike
|
|
|
|
|
Hi again,
The two ways that the buttons are shown can be seen here: http://cid-9dc6851d884739f8.skydrive.live.com/browse.aspx/Offentlig
Best Regards,
Katalin
|
|
|
|
|
Hi Katalin, I am getting access denied from my network nazis here at work, I will take a look when I get home.
led mike
|
|
|
|
|
Hi Mike,
There shouldn't be a problem with following the link to the two jpgs but since there is, is tere any way I can send them to you by mail?
Regards,
Katalin
|
|
|
|
|
Katalin21 wrote: There shouldn't be a problem with following the link to the two jpgs
It's my company's web proxy blocking my access to that site, not a problem with the links. I got tied up the past two days and couldn't check them out. I should be able to this evening.
led mike
|
|
|
|
|
hi..
hope this question already been posted , but i dont find tat, so tat m asking again. my problem s
i have some forms and reports n my application tat will take some more time to load. so i want to show some loading image or some else at this time . can anybody please help me to sort this , even a link s also prefered.
Thnks n advance..
cheers.
Sam
|
|
|
|
|
If you have some code that will take some time you can look into the BackgroundWorker.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
I've created a custom control, and a custom collection. I've also implemented a CollectionEditor so I can add items to the collection at design time.
In the Paint method of my control, I take each item in the collection and paint them much like a ListView in details mode.
My question is this:
When I add a new item to the collection, I need the Paint method to be called. I've found that adding or editing my collection through the CollectionEditor is not causing this to happen. As a reference- if you add an item to a ListView through the CollectionEditor setup for the Items property, you will see that as soon as you edit a property, the listview is updated in Visual Studio's designer. Mine is doing nothing when I edit a value... Does anyone know how the CollectionEditor should notify the control to repaint itself?
I don't think it will help to paste my code here, since this is more of a general question but here is my property with ample opertunity to cause a repaint:
[DesignerSerializationVisibility(DesignerSerializationVisibility.Content)]
[Editor(typeof(AccentListViewItemCollectionEditor), typeof(UITypeEditor))]
[RefreshProperties(RefreshProperties.Repaint)]
public AccentListViewItemCollection Items
{
get { return _Items; }
set
{
_Items = value;
pnlContent.Invalidate();
pnlContent.Update();
this.Invalidate();
this.Update();
}
}
Any advice wold be greatly appreciated! Thanks!
|
|
|
|
|
This article that I wrote: Targeting Design Time Events of UserControls[^] might be able to help you with the Visual Studio Designer.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
Unless I've totally overlooked something in your article- I couldn't find a section to help me out with this. I do appreciate the link though.
I think my confusion is that Visual Studio is firing the CollectionEditor code when the property is clicked in the property grid. So if VS has code to tell it when the CollectionEditor should be fired- It seems to me that the code that is firing the CollectionEditor should be responsable for telling the control to refresh. And if that's the case, I don't see how it would be possible for me to code this...
Of course, that must not be the case since the ListView Items property CollectionEditor doesn't behave like this. The ListView control itself is repainted as properties are updated in the CollectionEditor...
So I'm still obviously missing something...
|
|
|
|
|
One thing that I see is that you have a get and set for the collection property. When you add items to a collection you do not use the set part of the property, all alteration is through the get statement. You would have to create an event that will fire when the collection is altered. Ex:ListBox.Items is a collection property that does not have 'set' command (You can see this trough the object browser).
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios
Discounted or Free Software for Students:
DreamSpark - downloads.channel8.msdn.com
MSDN Academic Alliance - www.msdnaa.com
|
|
|
|
|
YES! You are my new hero!
My custom collection derives from System.Collections.CollectionBase which has a number of protected virtual methods that are fired when the collection is modified. Since the CollectionEditor is modifying the collection, I was able to hook in here.
I created a new delegate and event:
public delegate void OnRepaintControlHandler(object sender, EventArgs e);
public class AccentListViewItemCollection : CollectionBase
{
public event OnRepaintControlHandler RepaintControl;
...
...Created an event handler:
protected virtual void OnRepaintControl(EventArgs e)
{
if (RepaintControl != null)
{
RepaintControl(this, e);
}
}
...And then overrode the events that I needed my control to repaint on:
protected override void OnValidate(object value)
{
base.OnValidate(value);
OnRepaintControl(new EventArgs());
}
protected override void OnSetComplete(int index, object oldValue, object newValue)
{
base.OnSetComplete(index, oldValue, newValue);
OnRepaintControl(new EventArgs());
}
protected override void OnRemoveComplete(int index, object value)
{
base.OnRemoveComplete(index, value);
OnRepaintControl(new EventArgs());
}
protected override void OnInsertComplete(int index, object value)
{
base.OnInsertComplete(index, value);
OnRepaintControl(new EventArgs());
}
Finally, I registered for the event in my control, and invalidated the control on getting the event:
public AccentListView()
{
...
_Items = new AccentListViewItemCollection(this);
_Items.RepaintControl += new OnRepaintControlHandler(_Items_RepaintControl);
...
}
private void _Items_RepaintControl(object sender, EventArgs e)
{
this.Invalidate();
this.Update();
}
Again, thanks for your help- pretty sure I would not have figured this out without it!
|
|
|
|
|
hi,
I have got the .prn file(which is file for printing in driver level)
1.now i want to pick the file from the system/located in the server,
2.then i want to read some tags in that file.
All these tasks should be accompolished using the c#.net
Iam in a phase of high delivery...quick help is appreciated
thanks in advance
|
|
|
|
|
I have a DataGridView that runs hidden in the system tray, and when I unhide it the DataBindingComplete event fires anywhere between 3 and 8 times for the datagridview on the form, drastically slowing down the application. Is there something wrong with the databinding event? MSDN states that changes in the datasource will cause this event to fire. Why is changing the visibility firing it? This is the code for the system tray double click event.
Private Sub sysTray_MouseDoubleClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles sysTray.MouseDoubleClick
Me.Visible = Not Me.Visible
Me.ShowInTaskbar = Me.Visible
Me.WindowState = FormWindowState.Normal
End Sub
And here is the code in the databindingcomplete event:
Private Sub dgErrors_DataBindingComplete(ByVal sender As System.Object, ByVal e As System.Windows.Forms.DataGridViewBindingCompleteEventArgs) Handles dgErrors.DataBindingComplete
Debug.WriteLine("Fired event: dgErrors_DataBindingComplete: by " + CType(sender, Control).Name + " event Type: " + e.ListChangedType.ToString())
End Sub
The code produces the following output when double clicking on the system tray icon:
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
Fired event: dgErrors_DataBindingComplete: by dgErrors event Type: Reset
I dont understand why it is firing 7 times. In fact I don't understand why it is firing at all.
I need another event for the datagrid that fires only once, or I need to fix what is happening here somehow, any suggestions?
Thanx in advance for answers
|
|
|
|
|
bigbrownbeaver wrote: Why is changing the visibility firing it?
I have no idea. Have you looked at the call stack?
led mike
|
|
|
|