|
Hi coders.
At runtime i add textboxes and labels to the form. I want all selectable and can be aligned by user at runtime as .net UI does.
Any experience,source or idea???
|
|
|
|
|
You need to write code that captures mouse events, moves the controls and stores their position for next time.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi
You can use drag and drop facility to thus
|
|
|
|
|
Hi,
Can i somehow detect (and obtain handle to) windows dynamicaly created from withing a window? (by calling (new Form()).Show())
It must be done from the outside, knowing only the handle to the main window.
Thanks
|
|
|
|
|
Hi All,
I have a scenario where i need to print a large windows form design in the runtime with all the values entered in it by the user. I searched for many articles, where they have given way to print the screenshot of the form. In my case as the Form size is bigger i cant get the entire form in one screenshot.
Is there any way to acheive this ??
Thanks in advance
Cheers
Mani.
|
|
|
|
|
I have a windows application which uses webservice. So when a web reference is added, VS will add the webservice URL in the app.config file. Is there anyway to overcome this behavior ? Problem here is, when the application is deployed, users can open the configuration file and take the webservice URL. My webservice is secure and users can't make any harm to that, but I am just wondering any method available to change this URL storage location. Any ideas ?
|
|
|
|
|
Hi
Vs automatically put this url in app.config. But this is not the mandatory.i mean u can remove th url from the app.confg, then u can use the dat file, there can store and use the encrypt adn decrypt.
then can assign to ur url in to web service.
|
|
|
|
|
Ravenet wrote: But this is not the mandatory.i mean u can remove th url from the app.confg,
So are you telling that it will work event if I remove that entry from the config file ?
Ravenet wrote: then u can use the dat file, there can store and use the encrypt adn decrypt.
I am not getting your point. Can you please explain it more ?
Thanks for replying me.
|
|
|
|
|
Hi,
I am working on C# 2.0, I have to save some xml files in a folder which is hidden.
(I am able to save it in same folder when i unchecked its hidden-property).
plz do needful
thanks in advance!
Ahuja
|
|
|
|
|
Ahuja.bangalore wrote: plz do needful
*sigh*
Ahuja.bangalore wrote: bangalore
ah....
Ahuja.bangalore wrote: (I am able to save it in same folder when i unchecked its hidden-property).
There's no reason why you couldn't save to a folder that is hidden, but also no reason why you can't unhide it, save the files, and make it hidden again, in code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Remove the 'Hidden' attribute, save your files there and then apply the attribute again. Use the DirectoryInfo class for that.
|
|
|
|
|
actually i don't have to touch the (hidden) folder...this folder is on some other server where i have to copy some xml files.. for testing purpose i tried to copy some files at my local machine and found it doesn't copied at all
Ahuja
|
|
|
|
|
|
I'm not sure why you are having problems. This code works finne for me:
File.Copy(@"H:\Temp\00.xml",@"H:\Temp\MW Scripts\Hidden\bob.xml");
Are you getting any error message?
Bob
Ashfield Consultants Ltd
|
|
|
|
|
yes i got it, i was getting some error because of my fault that i had not given security permission according to my project..
thanks for all your replies...
Ahuja
|
|
|
|
|
Hi,
is there a built in Macanisam for aout Resize?
a Form is been MAX and all of it control are Resized?
THANKS
Have Fun
Never forget it
|
|
|
|
|
I thnk you need a spell checker.
Yes, just set the anchor properties of your controls so they resize as you want.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Christian Graus wrote: I thnk you need a spell checker.
I think so too
|
|
|
|
|
Hi all
I want to create a Menu in my application.iam using menu control for that.when i use this menu control "one arrow mark is coming in between" the menu items.can anyone tell me how to remove this arrow mark.also post me a link that explains step by step process, how to create a menu control in .net(c#).
any help will be appreciated.
thanks in advance.
pintoo
|
|
|
|
|
Hi Pintoo,
If you are referring to the SubMenu Items arrow then please know that it appear when we create some submenu items for a menu item like:
FileMenu
|
|
New-->SubMenuItemsList
|
|
Open
The arrow can be removed by removing the submenu items.
However, regarding your query of "how to create a menu control in .net(c#)." I would like to mention that we can create menus using C# in the following manner:
First add a MainMenu control to the form. Then to add menu items to it add MenuItem objects to the collection. By default, a MainMenu object contains no menu items, so that the first menu item added becomes the menu heading. Menu items can also be dynamically added when they are created, such that properties are set at the time of their creation and addition.
The following program shows how to create a simple menu.
The Class MenuTest1 creates a simple menu on a form. The form has a top-level File menu with menu items New,Open and Exit .The menu also includes a About menu.
-------------------------------------------------------------------------
BEGIN CODE
using System;
using System.ComponentModel;
using System.WinForms;
using System.Drawing;
public class MenuTest1 :Form
{
private MainMenu mainMenu;
public MenuTest1()
{
mainMenu = new MainMenu();
MenuItem File = mainMenu.MenuItems.Add("&File");
File .MenuItems.Add(new MenuItem("&New"));
File .MenuItems.Add(new MenuItem("&Open"));
File .MenuItems.Add(new MenuItem("&Exit"));
this.Menu=mainMenu;
MenuItem About = mainMenu.MenuItems.Add("&About");
About.MenuItems.Add(new MenuItem("&About"));
this.Menu=mainMenu;
mainMenu.GetForm().BackColor = Color.Indigo;
}
public static void Main(string[] args)
{
Application.Run(new MenuTest1());
}
}
END CODE
-------------------------------------------------------------------------
Hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
?Hi!,
I've created a new component, in constructor i set a default item
(Nothing in special)
New control definition:
public class NewListBox : System.Windows.Forms.ListBox
{
public NewListBox()
{
Items.Add("Hello World, this should appears one time!");
}
}
But when i drop this control on a form myForm.Designer.cs creates these lines automatically
//
// newListBox1
//
this.newListBox1.FormattingEnabled = true;
this.newListBox1.Items.AddRange(new object[] {
"Hello World, this should appears one time!"});
this.newListBox1.Location = new System.Drawing.Point(398, 6);
this.newListBox1.Name = "newListBox1";
this.newListBox1.Size = new System.Drawing.Size(228, 43);
this.newListBox1.TabIndex = 40;
And the result is the item is adding twice showing in execution
Hello World, this should appears one time!
Hello World, this should appears one time!
How can I avoid these designer automatic initializations.
Thanks in advance
|
|
|
|
|
Please verify that u didn't set the text property of your control at design time.
this appears to be a problem to me as u set the text property at design time and then again adding the same string in constructor
|
|
|
|
|
I'am not setting text property, and also this control has not Text property.
Nouman, the problem is caused by designer, in form.designer unit, when i drop the control it generates the same initiliazition as my control constructor, i know i can delete these lines from form.designer but is not the solution because i use my control in a lot of forms and i should delete these lines every time i use this control (is not logic). I am sure there is way to avoid it.
|
|
|
|
|
Try using the DesignMode or Site property to only adding the sample item when it is _not_ in design mode.
|
|
|
|
|
?thanks darkelv, but it not runs, why?
Because designer still writing
this.newListBox1.Name = "newListBox1";
in form.designer and in execution the control creates the first item due control constructor and the same item again due designer initialization, but thanks for the idea
|
|
|
|