|
Hi all,
I have a UserControl that manages a lot of editable information (like text-boxes). Now I need to make a version of this control that has a different layout (from horizontal to vertical). I can expose the control, like this:
public TextBox MyText
{
get { return myText; }
set { myText = value; }
}
i can now manually change the location and size, but this does not give me a visual reposition of them at design time.
Is there a better way of doing this ?
Thanks John
|
|
|
|
|
Hi John
How about a property in the control that changes the layout based on the value i.e. myControl.Orientation = Orientation.Vertical where the Orientation.Vertical is an enum held within the control.
Regards
The FoZ
|
|
|
|
|
In my project , we are used Mysql for database ... our application developed in c# winform application . Now we are creating deployment package using Visual studio 2008 ... user can install all prerequisites in a single click ... so i want add mysql also in a package ... how can do this ... please help me ... give some steps for how can achieve this ....
Thankyou
|
|
|
|
|
If Visual Studio's installer builder allows you to execute commands in the installation, you can let the MySQL installer run in silent mode.
I use Inno Setup for installers, so I'm clueless myself. But it's an idea.
People think it must be fun to be a super genius, but they don't realize how hard it is to put up with all the idiots in the world. - Calvin (from Calvin and Hobbes)(The Indispensable Calvin and Hobbes, p105-3)
|
|
|
|
|
I would like to write a program to be able to move a maximized window over to another monitor.
Some posts specify that you should first un-maximize the window, then move and then re-maximize the window.
I did and it works fine, except... it's not really nice to see.
You actually see the resizing of the window and it's slow too.
Moving a non-maximized window is much faster than moving a maximized one.
Any ideas in how to move the window in a nice fashion?
Thus without visual un-maximizing the window?
Thanks for any idea.
|
|
|
|
|
mvermand wrote: Any ideas in how to move the window in a nice fashion?
Thus without visual un-maximizing the window?
Hide it, restore it to a normal windowstate, move it, maximize it and show it again
I are Troll
|
|
|
|
|
Great Idea, but do you know how to hide a window based on its handle?
|
|
|
|
|
|
Hi
I've created a number of user controls to use on forms. What i need to do now is get a enum of variables from the form onto the user controls.
I am trying to write the code in the user control that just looks for a Enum with a fixed name on the form.
Any ideas? The problem i want to be able to reuse these controls on any form aslong as the Enum is there.
Chris
|
|
|
|
|
You can access a user control's parent's properties using the Parent property of the UserControl. If you need to access something not part of the Form class you'll need to cast the property to the Form type, but be warned, this can hinder reusing the control.
|
|
|
|
|
Hi Tony
Thanks for the help. The Parents propertiy it not something i have come accross before. Looking at a few points of the web and msdn.
I've manged to get the name of the control that the user control is on but not access the properties.
Chris
|
|
|
|
|
Hi Chris
Have you thought about passing the information from the form to the user control via a property. As Tony mentioned, trying to access in the way you are proposing will cause difficulties in reusability. using a property will make it easier to pass information back to the form (if required).
Regards
The FoZ
|
|
|
|
|
Hi TheFoz
Yes I no this would be the easiest way but would require some code to be added the form everytime you used the control.
What i was trying to do was have have enum on the main form. When the user control is droped on the form for it o read the enum and add it to a property of the user control. This way i could have multiple copies of the user control on the form and one of the properties of the user control would allow me to select from the forms enum.
Chris
|
|
|
|
|
I see!
Using this code in one of my custom controls I changed the colour of the form to alice blue when the user hovered their mouse on it
((Form)this.Parent).BackColor = Color.AliceBlue;
Using that you should be able to access the enum on the form
regards
The FoZ
|
|
|
|
|
Hi
Thanks for that. That could be very usefull but it only gives you access to standard windows form properties.
Chris
|
|
|
|
|
i need a datagridview inside datagridview in windows application.
the grid should be something lik this in the below link.
Grid Sample
Any help will be appricated.
thanks
|
|
|
|
|
sagarrana wrote: the grid should be something lik this in the below link.
That's a drill-down grid, could be quite a challenge to build. Doesn't Telerik's[^] grid provide something like this?
I are Troll
|
|
|
|
|
I just want to disable a particular item in a checkedlist box...I don't know how to do it..Please help...
|
|
|
|
|
Maybe the SetItemCheckState method will help you out...
|
|
|
|
|
You can loop through the items and then disable the one you want depending on your criteria
|
|
|
|
|
|
Re post [^]. Please just wait for some time till you get reply. Don't post your question in multiple forums, only on relevant.
|
|
|
|
|
hi thatraja,
i think this question is relevant to both c# and ASP.net. anyway thanks for suggestion.
|
|
|
|
|
you right, but the page & forms are more relevant to ASP.NET here, so you can get from there. cheers.
|
|
|
|
|
I have several controls that use the same context menu. How do I know which control was clicked to bring up the context menu? I want the context menu to be able to edit only the control that was originally clicked.
|
|
|
|