|
Hi,
Does anyone knwo what the IsRequired property is supposed to do for the ConfigurationProperty attribute? If i omit a required property in the configuration file, it doesn't throw an exception nor does it go into OnRequiredPropertyNotFound -- what does setting IsRequired to true do then?
Thank you!
stephen
|
|
|
|
|
I know this sounds noob, but I'm missing something here and I can't figure out what.
I have a class (we'll call it myControl) that inherits from System.Windows.Forms.Control.
In myControl, I override OnPaint.
I then add an instance of myControl to a Panel, hoping to see it there. However, it doesn't show up. What am I forgetting?
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Nevermind. I guess you can't set a Control's size in its own constructor (or, can you?). Anyway, I guess I need to look over my math...
Thanks anyway!
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello
Heritos Gger wrote: I guess you can't set a Control's size in its own constructor (or, can you?).
Sure you can!! Why not?
Regards
|
|
|
|
|
I guess you can after all. My math was wrong with what I was drawing, so I was drawing stuff outside the bounds of the control.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Is it visible ? I'd expect to see it, too.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Turns out my math was wrong with what I was drawing, so I was drawing stuff outside the bounds of the control.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hello,
Maybe you forgot to path, the base.OnPaint(..) in your "overrided"??? OnPaint Method.
All the best,
Martin
|
|
|
|
|
Turns out my math was wrong with what I was drawing, so I was drawing stuff outside the bounds of the control.
-Daniel
Typing too fast fro my owngood
|
|
|
|
|
Hi,
I'm having troubles finding information about drag&drop support for tray icons. I know you can drag&drop on a lot of controls in C#, but the events are not listed for the "notifyicon" (aka tray icon).
Has anyone tried this before ? Google didn't really help me on the matter either.
|
|
|
|
|
Hello
I guess you should handle the NotifyIcon.MouseUp event, but where to go from there is up to you
Regards
|
|
|
|
|
I don't think that'll work since you need to have something like the "DragEventArgs" to see which data is being drag&dropped.
And I don't know that much about changing controls to implement that into the notifyicon control
|
|
|
|
|
Hello
AFAIK and someone correct me if I'm wrong. Drag/Drop operation puts info about the dragged data in the clipboard if not the data itself. That's where the dropped in control knows what is dropped in it.
So, just try fetching them from the clipboard.
Regards
|
|
|
|
|
I need to be able to determine what user name a process is running under. I can get the process object by using...
Process[] p = Process.GetProcessByName("theprocess");
But I need to know if the process is running under the same user name as the account that the current user is logged in under. I know I can get the user name with Environment.Username, but I need to get the process' user name like Task Manager does.
Can anyone help?
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Hello
Process[] p = Process.GetProcessByName("theprocess");
MessageBox.Show(p.StartInfo.Username);
Regards
|
|
|
|
|
I found a previous reference to that, but the StartInfo object that comes up in my IDE does not have a "Username" property.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
Hello
ProcessStartInfo.Usename property is available in .net framework 2.0 or later. Probably you're using version 1.1 or 1.0. Upgrade to .Net 2.0 by buying Visual Studio 2005, downloading Visual C# express edition, or downloading .Net 2.0 SDK and using its libraries explicitly.
Regards
|
|
|
|
|
Use WMI or Windows Management Instrumentation. Build a Management Object on the process under discussion. Call its InvokeMethod() and pass "GetOwner" as the method parameter. This way, you can find the owner of a process.
Best,
Jun
|
|
|
|
|
Thank you - this solution worked great for me. I sincerely appreciate your willingness to answer my question.
Darryl Borden
Principal IT Analyst
dborden@eprod.com
|
|
|
|
|
You're welcome. Glad my advice was useful.
Best,
Jun
|
|
|
|
|
Ok I have got my page to display the data I need using a store procedure etc. What I need to know is, how do I create an input text form box (IE: Enter ID here with a submit button and pass that variable to the (ident = 1) below to make it (ident = textboxvariable). Any help would be appreciated thanks! =)
<%Dim ident
'select your product_id
ident = 1
Dim connection
Dim rs
'create the connection
connection = Server.CreateObject("adodb.connection")
'create the connection (here we used a DSN - use any standard connection
connection.open("Driver={SQL Server};Server=X;Database=trd;Uid=X;Pwd=X;")
'create the recordset
rs = Server.CreateObject("adodb.recordset")
'open the recordset, passing in the variable
'note that the variable product_id does not have to be name the same as in the stored procedure, it just needs to be the same data type.
rs.Open("Exec GETID " & ident, connection)
'display the recordset
Do Until rs.EOF
For Each ident In rs.Fields
Response.Write(ident.value & "<br />")
Next
Response.Write("<br />")
rs.MoveNext()
Loop
rs.close()
connection.close()%>
Jesse Myer
jessemyer06@aol.com
-- modified at 16:24 Tuesday 22nd August, 2006
|
|
|
|
|
Please don't cross post.
---
b { font-weight: normal; }
|
|
|
|
|
Hi All,
I have a business object, an "Asset", which takes it's data from a database table. Now, the "Asset" has a field called CompanyID, which is an int. This is great for the database, program and developer(me), but users might baulk at having to refer to numbers. Naturally, CompanyID is a relation to another table in the database.
So my question is: what's the best way of including a human friendly CompanyName in the Asset object? I could create a property which is filled in when the object is created from the db data, or I could have the object look up it's CompanyName whenever required or... What's the best thing to do?
Thanks,
Martin.
|
|
|
|
|
I'd expect the class to have a private ID and a public string for the name. Any object once read is disconnected from the database unless you re-read it, generally I think it's accepted that what you're looking at is the object at the moment you first requested it.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
What I usually do is to join in the company table, so that I can fetch the company id and the company name in the query. Then I create a Company object from those, and store that object in the asset object.
To access the name of the company, I use: theAsset.Company.Name
---
b { font-weight: normal; }
|
|
|
|