|
can you tell me what's wrong with this code here. there is only
one error, but I am not sure what it is. the problem is, that
the code that follows will not load a registry value into a textbox
I used a variable that was declared as "public static string" near the top
of Form1 (the first statement in the Form1 class near the top
of the page). this variable is used to tell part of the location
of registry key.("key1\\subkey1\\" + Form1.Variable + "")
I used Form1.Variable, becuase I am accessing the variable in another form
on the form's load event. However, when I use something like
("key1\\subkey1\\thisisnotavariablebutastring"), it actually works fine
without raising an exception. here is the code
<br />
public static string person1;<br />
<br />
RegistryKey key17 = Registry.CurrentUser.CreateSubKey("FamilyHome\\" + Form1.person1 + "");<br />
this.textBox1.Text = key17.GetValue("Monday").ToString();<br />
this.textBox2.Text = key17.GetVAlue("Tuesday").ToString();<br />
this.textBox7.Text = key17.GetValue("Sunday").ToString();<br />
<br />
<br />
if you need more info, or you want me to send you the full project with all<br />
the source code, let me know. I am so very grateful for your help.<br />
<br />
thanks,<br />
<br />
Stephen
|
|
|
|
|
Hi,
I have a set of values(currency codes) stored in the database which I would like to retrieve and display in a Property grid as a non-editable drop down list at runtime.
I tried reading the properties into a ArrayList and then displaying the same in the Property Grid but that did not show up the drop down list.
Can anyone suggest how to go about doing that.
Thanks in advance!
Jaydeep
|
|
|
|
|
Check out the TypeDescriptor Class[^], there is an overloaded method called GetProperties which allows you to return a PropertyDescriptorCollection of properties. You can use the SelectedObject property of the PropertyGrid to assign your object. This should get you started.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi,I need to read arabic characters from an already written file as it didnt see them at all
Eman Badr
|
|
|
|
|
hi, i need to create a webservice and i need an application to retrieve some binary files from this webservice (like updating). i would like to know how can i do for the webservice to transfer these files. is there some way to do it via ftp or http?
thanks,
|
|
|
|
|
Hi, I would like to know how to load 2 instances of "notepad.exe" (or any other exe) on each side of a split container inside my form, not to load when my application starts as an external program, but make it a part of my form so they both load inside my application when I start it.
|
|
|
|
|
what?? you can't do this unless you find a custom control and add it or you make your own.. its pretty easy to make it by yourself though..
IM PROUD TO BE A GMAIL;
|
|
|
|
|
It CAN be done, but you have some major technical hurdles to jump through. In general, it's not possible to redirect the window of an application into the window of another app. And, no, I've never done this before. I've heard of it being done and how the process is accomplished, but don't ask for example code. I don't have any.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello,
I have a datagrid with a list of customers. I want to be able to click on the row then be able to display the customer number which is in the first column of that row.
I have code for finding the row number:
rowNumber = grdDisplayCustomers.CurrentRowIndex;
But how do find out the customer number which is in the first column of that row.
Many thanks in advance,
Steve
|
|
|
|
|
Have you tried using a hyperlink column? Not sure if this will work for you but you could have column 1 with text 'View Details' and have this as a link to another page displaying the customer info. Something like this...
private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs e){
//cast to dataGrid as that is what you are using
DataGrid grid = (DataGrid)sender;
//redirect to page you display customer info in passing customer number from column 1 (column 0 is your hyperlink column)
string page = "newpage.aspx?id=" + grid.Items[grid.SelectedIndex].Cells[1].Text;
Response.Redirect(page,true);
}
Just an idea!
Colin
|
|
|
|
|
grdDisplayCustomers[grdDisplayCustomers.CurrentRowIndex,0];
|
|
|
|
|
I want to get the size of the responce from a web service and compare this with the size of a responce from a local function.
Does anybody know how i might do this?
Code samples appreciated
Thanks in advance
Colin McAdam
(.NET wanabe)
|
|
|
|
|
Hi all!
I was wondering if anyone has an idea what I can do to support more than one version of a third party ActiveX control in my application.
The problem is that I can't have more than one version of the third party application installed at a time and if I build against the older version I cannot access features of the newer version's ActiveX controls.
Right now I can't think of anything else but to duplicate my sources and develop on two machines in parallel, one with the old version and the other one with the newer version. This doesn't satisfy me, though, because then everything has to be programmed twice
Any ideas anybody?
Thanks in advance,
Mav
|
|
|
|
|
Hi everyone, I'm having a problem with EntryPoint when using DllImport in C#.
I have a MFC C++ class and want to import it to C#, but I don't have a EntryPoint?
The code is invalid, "Unable to find an entry point named MyClass::GetValue in DLL myclass.dll"
Many thanks for any help,
/Gywox
// C-Sharp, Import dll
using System.Runtime.InteropServices;
namespace CSharpDllImport
{
public class MyClass
{
[DllImport("myclass.dll", EntryPoint="CMyClass::GetValue", CharSet=CharSet.Auto)]
public static extern int GetValue();
[DllImport("myclass.dll", EntryPoint="CMyClass::SetValue", CharSet=CharSet.Auto)]
public static extern void SetValue(int v);
}
}
// MFC C++, Export dll
class __declspec(dllexport) CMyClass : public CObject
{
protected:
DECLARE_DYNCREATE(CMyClass)
public:
CMyClass() { }
virtual ~CMyClass() { }
public:
int GetValue();
void SetValue(int);
private:
int m_iValue;
}
int CMyClass::GetValue()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
return m_iValue;
}
void CMyClass::SetValue(int iValue)
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());
m_iValue = iValue;
}
|
|
|
|
|
You can use the DllImport attribute to P/Invoke flat C/C++ based dlls to expose their functions, not functions belonging to a class written in MFC. Your best bet would be to create a thin MC++ wrapper class (as a proxy) that would allow you access to your MFC classes. You could then create an instance of this MC++ wrapper in C#.
- Nick Parker My Blog | My Articles
|
|
|
|
|
Hi there!
I have here a problem with the X (close) Button.
When I click the button to Exit the application, the form closes but if I see in the windows task manager, the application continues to Run.
What I have to do to end the application process?
Thanks
|
|
|
|
|
Do you start any extra threads while running your applications?
If so, set their IsBackground property true , cause background threads do not prevent a process from terminating. Once all foreground threads belonging to a process have terminated, the common language runtime ends the process by invoking Abort on any background threads that are still alive.
www.troschuetz.de
|
|
|
|
|
oh, I had that problem. all you do is this.
in the properties panel, go to events.
then next to the "closed" event, in the space next to it,
double-click the space. this will allow you to change events that occur when the form closes.
type this:
Application.Exit();
normally, when you just click the "X" button, it simply closes the form, but when you type "ApplicationExit();", it ensures that all forms are closed and the process is ended.
let me know if it worked or not
|
|
|
|
|
oh, I had that problem. all you do is this.
in the properties panel, go to events.
then next to the "closed" event, in the space next to it,
double-click the space. this will allow you to change events that occur when the form closes.
type this:
Application.Exit();
normally, when you just click the "X" button, it simply closes the form, but when you type "ApplicationExit();", it ensures that all forms are closed and the process is ended.
let me know if it worked or not
|
|
|
|
|
oh, I had that problem. all you do is this.
in the properties panel, go to events.
then next to the "closed" event, in the space next to it,
double-click the space. this will allow you to change events that occur when the form closes.
type this:
Application.Exit();
normally, when you just click the "X" button, it simply closes the form, but when you type "ApplicationExit();", it ensures that all forms are closed and the process is ended.
let me know if it worked or not
|
|
|
|
|
whoops. sry about all the replies. don't trust i.e.
use opera
|
|
|
|
|
Just delete all the other ones. That's what the delete link is for.
This posting is provided "AS IS" with no warranties, and confers no rights.
Alex Korchemniy
|
|
|
|
|
Hi ….,
My name is Muhammad Waqas Butt. I was your student in Aptech. I have some problem in winforms.net. I have a project of book store system and old version of this system (software) is DOS base and database in FoxPro. Actually I haven’t work with FoxPro database the thing is now that I want to know that; is there such way that we import data from FoxPro to MS Access 2000, XP or SQL Server 2000? Or can we work with FoxPro database in C#.net and how? Second is that there are many problems in their database mean they enter a single record twice and even more time which makes data so complex. Third is about winforms printpreview control. How can we take preview of datagrid and customize it. Spouse we create a form which have some fields and datagrid control in bottom we have a button for printpreview. If we click on this button a printpreview dialog box open I can jump labels and text boxes value in printpreview but I am fail to jump datagrid on there. And customize it like horizontal lines, alignments of text. So I think you understand my problem and I hope you will help me as soon as possible. And if you have some references regard these problems and .net so please tell about them also I shell me highly thankful to you.
Thanks…
<marquee>Muhammad Waqas Butt
|
|
|
|
|
WaqasButt wrote:
s there such way that we import data from FoxPro to MS Access 2000, XP or SQL Server 2000?
Yes: try DTS, ODBC, ADO or OLEDB providers for DBase, they should work with FoxPro database, IIRC.
WaqasButt wrote:
Or can we work with FoxPro database in C#.net and how?
Yes and no: while it is possible to work with a .DBF DBase database in C#, it'd not be safe to use it while the old application is running - old FoxPro, Clipper and DBase applications often had their own locking schemes - most of them flawed. Touching a database like this should be done with very care...
Yes, even I am blogging now!
|
|
|
|
|
Thanks...Daniel Turini for spending time of my database problem. Now i may be use sql server and make new database. But anyways if you have knowledge about winforms problem or some references or books so please told me about them.
Thanks...
|
|
|
|