|
You don't need to access the file directly.
Use the classes in the system.configuration namespace to access the configuration file.
If you just have simple string data to access then you can use the AppSettings class and section.
Otherwise you can write your own section handler.
The file should be named yourexe.exe.config, but vs.net will copy any file named app.config from the root of your project to the output directory and rename it to the proper name so your service will read it.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
|
Anyone knows how to disable the tab key function in window form (which move the focus to the next control in the form)? I want my rich text box processes the tab key press like any other key.
Thanks for the answers
|
|
|
|
|
See the AcceptsRab property[^].
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Just Set RichTextBos's "AcceptsTab" property to "True".
Happy Coding.
Sheel Gohe
|
|
|
|
|
haha, code a lot and forget so simple thing
|
|
|
|
|
Thanks guys!
|
|
|
|
|
I'm building a usercontrol that has multiple buttons on it, and i need to set one of them as the accept button, but i can't find anything about how to do this.
From what i can see it is only accessable from the Forms.Form not Forms.UserControl...
Is this entirely the truth, or can I still somehow set this to work so it validates against my "Ok" button, when someone hits enter.
string Beautiful = "ignorant";
label1.Text = "The world is full of " + Beautiful + " people.";
Why is common sense such an un-common comodity?
|
|
|
|
|
Your user control can't have an AcceptButton property because what happens if there are multiple user controls on the same form and all have that property set? which is the one that counts?
A workaround is to expose a public read only property named something like DefaultButton , and have it return a reference to your OK Button . Then, the form can set its AcceptButton property to that reference. Or the other way around, make the form pass a reference to itself to the user control, so it can set the form's AcceptButton property (I like the first way better).
-- LuisR
Luis Alonso Ramos
Intelectix - Chihuahua, Mexico
Not much here: My CP Blog!
The amount of sleep the average person needs is five more minutes. -- Vikram A Punathambekar, Aug. 11, 2005
|
|
|
|
|
Hi,
I would like to find an example of ruler control, does anyone have this experience ? I would like how to do ~, thanks !!
|
|
|
|
|
A ruler control is a pretty simple owner drawn control, I'm sure google will bring you some matches.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
|
thanks all of you, it should give me some hints
|
|
|
|
|
Hi :
How can I darg-drop item to a WebBrowser control ?
I created an application written by C#,it includes two forms , one form
includes a TreeView control , the other includes a WebBrower control and a
TextBox control, now we call them as Form1 and Form2.
First , I try drag a item to the TextBox control,(I have set TreeView for
drag well ) I set
"this.textBox1.AllowDrop = true;" then add Events and write these methods:
this.textBox1.DragOver += new System.Windows.Forms.DragEventHandler
(this.textBox1_DragOver);
this.textBox1.DragDrop += new System.Windows.Forms.DragEventHandler
(this.textBox1_DragDrop);
this.textBox1.DragEnter += new System.Windows.Forms.DragEventHandler
(this.textBox1_DragEnter);
Run this application,and drag item from TreeView which in Form1 to TextBox
which in Form2,the TextBox 3 Events (DragOver,DragDrop,DragEnter) is done
well.
But when I want drag item to the WebBrower,I can not find DragEnter Event and
others Events related to "Drag-Drop",so I can not drop Item to WebBrowser.
Also I have tryed set WebBrowser's Document.DesignMode="On",but can not drop
too.
Then I Write a HTMLBody's ondragenter Event ,but this ondragenter() can not
trigger.
So I think it must be solved by COM knowledge.
Can any one give my some suggestion,
because my COM knowledge is poor, if anyone give me an all solved code ,I
will be very appreciated.Thanks very
|
|
|
|
|
You can't drag and drop onto a web control. What were you hoping to drag and drop onto it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Thanks for your reply,well,I'm doing a HTMLEdit control writen by c#,and I want to drag a html tag item into this control,then I paste a tag html into this control.
Sorry for my poor English ,but I really want your help ,thanks
|
|
|
|
|
No need to apologise, I'm glad to help, but a WebBrowser control does not show HTML, it just renders it. And it doesn't support drag n drop.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
If I add WebBrowser control in VB6.0 ,then I could drag items to it and drop,I think Com control to Com control is works ok ,but when add WebBrowser control in .net programe,it doesn't work.
You are right "WebBrowser control does not show HTML",but WebBrowser control has a DOM property,and use mshtml.HTMLDocument Interface ,I can control it's html,what I want to do is draging item into WebBrowser control,and when droped I add some html string into some where by mshtml.HTMLDocument interface.
If some one want simple code,I can send it to your Email adress,my email is cecilia_in_love@163.com .I really want help!
Also sorry for my poor English ,I'm not a English speaking country.
|
|
|
|
|
OK, I didn't know that the browser control had drag and drop at all. It's kind of weird, I mean, if you drag and drop a string, how will you know where in the DOM to put it ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Greetings,
I've successfully implemented MS's control array as prescribed in this article:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchcreatingcontrolarraysinvisualbasicnetvisualcnet.asp
But I would like to implement a two dimensional control array. I'm adding buttons to a series of tab pages, and I need to be able to address the buttons on each tab page.
Is it possible to modify the class provided in the article to support a second dimension? I'm a newbie at C# so I will need a few key lines of code which illustrate the modifications needed. Thanks.
|
|
|
|
|
if you need to access Button in tabPage you dont have to create array as when you add control to tabpage this control will be add to controls collection of tabPage
to access all the button in tabpage you can write somthing like
foreach(Control ctl in tabPage1.Controls)
{
if(ctl is Button)
{
Debug.WriteLine(ctl.Name);
}
}
MCAD
|
|
|
|
|
Hi
I need help as i have a usercontrol loaded at runtime on a main form .What i want to do is on click of a button on usercontrol i want to refresh the treeview control with fresh data on the main form and load other control on the main form. how can i do that.
thanks
monica
|
|
|
|
|
Set up a delegate which you call when the button is pressed, and which the main form ties to a method that refreshes the tree control.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
can u explain a bit more a give me some example site to have a look at it i am new to c#.net
thanks
|
|
|
|
|
Oh, you've made the leap from VB ? Congratulations !!
Here[^] is an online tutorial. Basically, your control contains a definition of an event ( a delegate ) and an instance of that type. It defaults to null, and when the button is pressed, if it's not null, it calls it. The main page sets this variable to be a function IN the main page which matches the definition. In this function, you refresh the tree view. This function is then called by your control whenever the button is pressed.
Christian Graus - Microsoft MVP - C++
|
|
|
|