|
I have a MessageBox that pops up in a try/catch block (catch). It has an
"OK" button and an "X" in the upper right of the Non-Client Rect.
Is there a way to access the behavior the "OK" and the "X"?
|
|
|
|
|
Anonymous wrote:
Is there a way to access the behavior the "OK" and the "X"?
That's really vague. What do you mena by "access the behavior"? What do you want to do with this?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I guess I want to know how to use them as parameters in a control struct.....if that makes sense -- thanks
|
|
|
|
|
SkunkedWorks wrote:
if that makes sense
Nope.
Are you saying that you want to use the return value from the MessageBox to determine which button was clicked?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hi,
i have 2 problems, when i read the Excel-Tabel in the Datagrid!
<br />
string sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source=@C:\\Test.xls;" + "Extended Properties=Excel 8.0;" + "HDR=Yes;IMEX=1";<br />
<br />
OleDbConnection objConn = new OleDbConnection(sConnectionString);<br />
<br />
objConn.Open();<br />
<br />
OleDbCommand objCmdSelect =new OleDbCommand("SELECT * FROM [Tabelle1$]", objConn); <--- An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll<br />
<br />
OleDbDataAdapter objAdapter1 = new OleDbDataAdapter();<br />
<br />
objAdapter1.SelectCommand = objCmdSelect;<br />
<br />
DataSet objDataset1 = new DataSet();<br />
<br />
objAdapter1.Fill(objDataset1, "XLData");<br />
<br />
dataGrid1.DataSource = objDataset1.Tables[0].DefaultView;<br />
dataGrid1.DataBind(); <-------- System.Windows.Forms.DataGrid' does not contain a definition for 'DataBind'<br />
<br />
// Clean up objects.<br />
objConn.Close();<br />
cu
|
|
|
|
|
Something more of the first error message, than just the type of the exception object, would be helpful...
The second error message is very straight forward. There simply does not exist any method called DataBind in that class.
---
b { font-weight: normal; }
|
|
|
|
|
hm
An unhandled exception of type 'System.Data.OleDb.OleDbException' occurred in system.data.dll
maybe the SELECT satement isn't correct!?
cu
|
|
|
|
|
hi it works:
<br />
string sConnectionString = @"Provider=Microsoft.Jet.OLEDB.4.0;" + <br />
cplusplus @"Data Source=C:\Test.xls;" + <br />
cplusplus @"Extended Properties=" + Convert.ToChar(34).ToString() + <br />
cplusplus @"Excel 8.0;" + @"HDR=Yes;IMEX=1" + Convert.ToChar(34).ToString();<br />
but why so often @? whats the meaning of @ ?
cu
|
|
|
|
|
The only thing that tells you is that the error message originates from the database. It doesn't say anything at all about what caused the error. That's why something more from the error message would be helpful.
---
b { font-weight: normal; }
|
|
|
|
|
hi,,
if we have this scenario:
computer A: My Database
computer B: My Application
computer C: My Application
computer D: My Application
now what is the best way to logon into the database from the application.. i am talking about LAN network... and where is the best way to store the database logon information. i mean if my application is installed in computer B.. where should i save the database logon information in this computer so i can make sure its safe..
one more thing,, what is the best way to retrieve info from the database after i logon.. should i use direct connection and take what i want and then disconnect.. or is there any other way..
thank you very much...
|
|
|
|
|
That depends...
What type of database are you using? Access? MySQL? MS SQL Server? Oracle? ...
From whom do you need to protect the logon information?
---
b { font-weight: normal; }
|
|
|
|
|
i am using sql server... and i am protecting it from the users because some of them are pros... and i want to do something pro as well...
|
|
|
|
|
If you're using SQL Server, I'd go with integrated login.
|
|
|
|
|
|
hi to all,
can someone point me in the right direction as to how i go about customizing a TextBox so that it looks like a .NET IDE editor, that is i want to draw a coloured column down left side for line numbers and possible have line folding as well
have googled but nor really comne up with anything specific, only on how to custom draw a control.
i tried this just to see if i could get a column but i got nothing
<br />
public class EditorPane : TextBox<br />
{<br />
public EditorPane()<br />
{ <br />
this.Multiline = true;<br />
this.Size = new Size(300, 300);<br />
}<br />
<br />
protected override void OnPaint(PaintEventArgs pe)<br />
<br />
{<br />
pe.Graphics.FillRectangle(Brushes.Gray, this.Location.X, this.Location.Y, 35, this.ClientSize.Height);<br />
base.OnPaint (pe);<br />
}<br />
}<br />
kind regards,
g00fy
|
|
|
|
|
At first VS editor not standard textbox most code editors create there custom control
Second the left bars that show line folding and line numbers is not draw in the textbox but there are other control itself because the custome editor contain more than one control one of them to display colorized text and others for other tasks like like folding,...
if you want source code for VS code editor like look at the #develop[^]
download the application and looking for the editor source code
I Hope this help
MCAD
-- modified at 15:01 Sunday 11th September, 2005
|
|
|
|
|
that was my first option, but i am having trouble finding it in all the code, have you any ideas of the namespace or class ?
regards,
g00fy
|
|
|
|
|
under namespace ICSharpCode.TextEditor or you can search for textAreaControl.cs you can get more information by reading Dissecting a C# Application: Inside SharpDevelop by written by appliaction developers it is available for free at http://www.apress.com/free/[^]
MCAD
|
|
|
|
|
thank you i will do that
g00fy
|
|
|
|
|
Hi everybody,
When my Win forms app runs I need to check whether somebody has changed the system time (more specific: my app has some kind of a max usage days, kind of like any kind of trial ware, but I cannot rely on an internet connection being present).
I thought already of two options but both are not satisfactory:
1) Add a windows service to the machine and let that one check every x seconds/minutes whether the time has changed. (not good, cause I don't want to add such an overhead to the system).
2) When the app runs it sets the current datetime in the registry, next time it runs it checks whether the current date is later than the one of the previous run. (not good since one can everytime turn back the system clock to 1 second after the last run).
It would be great if I could find out the specific datetime on which Windows started, than take the number of seconds it was running (existing API), and by doing basic math see if the time has changed (taking into account a max 60 minutes difference for day light saving time). Does anybody now how to get the startup datetime of windows?
Or does anybody have another good idea?
Thanks,
Gideon
-- modified at 7:40 Sunday 11th September, 2005
|
|
|
|
|
Option 1 - Not good because what's stoping the user from stooping the service? Plus, you can change the system time without Windows even running.
Option 2 - The registry is a poor place to store information like that. It can be easily changed to reflect a date/time (if you store it as such).
It would be better to track how long your application has been in use. This means incrementing a counter for each minute that ticks by. You could then hide this value in a bogus .DLL file somewhere, preferrably encrypting the value before you write it to the file. Then just decrpyt it and start incrementing the value again the next time the app is started. This method has the advantage that it does rely on the system time at all.
After so many minutes, you just give a notification and quit.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I agree with you on what you wrote regarding to option 1 & 2.
But the solution you set forth is also not 100% satisfactory:
1) The marketing people want a solid expiry date, not one depending on the time it is used.
2) The whole encryption issue (also an issue when storing in the registry) is probablematic, since the encryption keys are stored on the machine of the user (remember, the app cannot rely on an internet connection). But the truth since it is .NET, one can just break the whole date verification out of the code, so that we have to take for granted.
Thanks anyway for your response. And let me know if you come up with some other solution.
Gidon
|
|
|
|
|
gnjunge wrote:
But the solution you set forth is also not 100% satisfactory:
And let me know if you come up with some other solution.
Marketings expectations are also outside the capabilities of Windows, or any OS for that matter. There is absolutely no way to guarantee that the system time your getting is accurate and no way to be reliably notified of any changes to the system clock. Sorry...
gnjunge wrote:
since the encryption keys are stored on the machine of the user
Yes, this is true. But not how you might think. There are a more than a few places in the registry to get an encryption key or salt for an algorithm, such as the SID for the Administrators account. This way, you don't have to store the key/salt yourself, it's already done for you, cleverly disguised as a useful part of the system.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the info. I will talk here with marketing.
|
|
|
|
|
Two Visual studio user interface questions: Reorder and collapse functions...
(Good abbreviation? )
The first question:
Is there any tool or inbuilt funcion in VS that reorders functions?
I got a 10 classes and each got a lot of funcs and data, but all derive from a special class, and thereby have the same funcs. It would be a lot easier to look at them if they where in the same order.
And the second question:
Is there any way to collapse only all functions?
Niklas Ulvinge aka IDK
|
|
|
|