|
|
Everybody here has probably used :
MessageBox.Show("Hello");
The problem I am working on is that when you create a message box in this way it puts an 'OK' button and this button has focus so if you press return it closes the box.
Is there a way to display a messagebox where the 'OK' button doesnt have focus, therefore forcing the user to click the button?
|
|
|
|
|
doesnt that violate the user experience rules?
but just inherit the thing and impose your own rules.
|
|
|
|
|
Yes it does, but for my sins (I must have been really evil in a past life) the users I code for ask for the strangest things.
I use message box to display certain bits of information and the users are simply pressing return without reading the message as 99% of the time they 'know' what it will say, unfortunatly for me and them 1% of the time the message is different and if they dont acknowledge what it tells them it spams everything they are working on.
So in an attempt to rein in my users, I want to force them to click - its about as much as I can do, short of writing an ElectrocuteUser class (which would be nice )
In the end I did what you suggested and used inheritence, ho hum, tomorrow is just another weird request away.
|
|
|
|
|
well cool. What I did before .net was alive was made my own MessageBox form and used enums to imitate it.
you might try that cause then you can get a custom type message box
|
|
|
|
|
Ans actually you might even think of using error providers and more validation to make thier life more hell and make yours easier.
|
|
|
|
|
Hi!
How to properly add attachment to new Outlook.MailItem ?
I've made it that way:
this.mail.Attachments.Add(FileName,1, null, fname);
It looks correct, I can also save this attachment by calling
this.mail.Attachments.Item[i].SaveAsFile(FileName);
but the problem is that attachments are not sent with the message (or maybe they are included, but not "visible" in outlook).
Any ideas?
thanx
h.
|
|
|
|
|
We are building a large Win32/web n-tiered system and I'm looking for some comments of the various security models available.
Some of our components will be webservices and some will be using .NET remoting (on TCP) so we can't use the normal pass-through security.
We intend deploying within an Active Directory environment.
All our rights management information will be stored in A.D. and our SQL server.
Our initial idea was to pass the username as the first parameter of method calls and have this used by our security.dll component. Obviously this can be easily spoofed, so we're currently looking for other options.
How are you guys currently doing this?
Cheers,
Simon
"Don't try to be like Jackie. There is only one Jackie.... Study computers instead.", Jackie Chan on career choices.
animation mechanics in SVG (my first abstract photo)
|
|
|
|
|
Hello friends
I have some problem dynamically showing HTML pages that have tags. Say I have a string like this :
strHTML = "<html><body><h1> Test </h1></body></html>"
I can easily load this string in my Microsoft Web Browser control as below :
IHTMLDocument2 doc = (IHTMLDocument2 )MyBrowser.Document;
doc .body.InnerHTML = strHTML ;
But, what if I would have some tags in my document ?
strHTML = "<html><body><h1> Test </h1><img src="Images/someImage.jpg"></body></html>"
In this case, I have created Images folder in the same folder as my *.exe file exists. But the image is not shown as I expect! note that the path of src attribute is relative, so I don't understand really what's the problem!
please help!
Don't forget, that's Persian Gulf not Arabian gulf!
|
|
|
|
|
Hi,
Does anyone have any ideas how i can get at the glyph outline of truetype font characters? I know in c++ i can use structures like glyphmetrics etc but am trying to find a way in c#, if its possible??? Any help would be good
Adam
|
|
|
|
|
|
I have an application that takes a load of data and pumps it into a Datagrid, the problem I have is that I want to be able to retrieve all the values for the currently selected row in the grid.
Is there a way of using the current row index to retrieve all values into a DataRow (I also need the column header names aswell)?
At the moment I am doing this a god awful and rather restrictive way, by using :
int selectedrow = myGrid.CurrentRowIndex
string val0 = myGrid[selectedrow, 0].ToString();
string val1 = myGrid[selectedrow, 1].ToString();
string val2 = myGrid[selectedrow, 2].ToString();
string val3 = myGrid[selectedrow, 3].ToString();
.....
I am open to any other suggestions, as I dont have to use a DataRow - so over to you guys.
Thanks
|
|
|
|
|
Well I have found what seems to be a solution to my problem. The following code will get the currently selected datagrid row into a datarow :
CurrencyManager cm = (CurrencyManager)dgOrgData.BindingContext[dgOrgData.DataSource];
DataRowView drv = (DataRowView)cm.Current;
DataRow myRow = drv.Row;
Now the plot thickens a little, I use this code to get the datarow values for a datagrid row when a user right right clicks on the datagrid (code is in a contextmenu event) - what I would also like to get is the cell value that the user right clicked on?
|
|
|
|
|
Hi guys !
I've a WinForm with 2 ListView control and I've something special to do with the 2nd ListView. If user changes something (like ColumnHeader size) on ListView 1 then this change will be applied on ListView 2 too.
My first approach was to override WndProc of ListView 1 and foward all messages to ListView 2 (via Win32 api function SendMessage()) but it was unsuccessful.
Any idea ?
--
Regards,
Julian.
|
|
|
|
|
why not just add a delegate for the event then execute a command on the second
|
|
|
|
|
Input from where exactly? From a file, from a stream, from a console application, from a form?
Without context, I can't help you. Mind you, even with context, the question may have no answer either . For example, if you're using a TextReader, you can't get at the "raw" character; it'll have been translated into a standard UNICODE character.
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
DeanAgan wrote:
Its actually read from a textbox. Translation into a standard unicode? How do u do that? The code is suppose to block input in the textbox that exceeds 32 characters. But if I would input in Chinese characters, which has a double byte character set, then even if only 32 characters are inputted, problems would still arise coz its actually 64 characters in single byte character set. Im looking for what class to use, though I can solve it without using a class and just by looping through it.
When you are talking about the MaxLength property of the TextBox , that is refering to the actual number of character entries that are allowed, not the number of bytes. Under .NET, the TextBox 's Text property returns a String data type which is of Unicode encoding where all characters are two bytes long.
-Nick Parker
|
|
|
|
|
I heard that C# and other .Net app can be compiled as then native app,don't need to use JIT.
How?
Thank you!
Let's roll!
|
|
|
|
|
Check MSDN for ngen.exe
Alexandre Kojevnikov
MCAD charter member
Leuven, Belgium
|
|
|
|
|
It's really funny,take a look at your app build by vs.net 2003.
I have a app that is 36KB just after been build. But when I run it by double click it and close it. It's size expand to 56KB. And then I run it again,it's size shrink to 36KB,and I close it,well it's size expand to 56KB.
Why? How can it change it's size during runtime?
Well I try the same way using C# Builder. It doesn't happen.
|
|
|
|
|
I just used Borland C# Builder and use it to develop a same program that I used to in vs.net 2003. I found C# Builder compiler is much faster than vs.net. And the program size it build is smaller.
Why?
|
|
|
|
|
Are you working for Borland ?
There is no "C# Builder compiler"...C# Builder is using csc.exe just like VS.NET, so what are you saying there is impossible.
|
|
|
|
|
Are you sure! I don't think so. Just take a look of my recent message,it shows different.
Let's roll!
|
|
|
|
|
Yes, Borland licensed the standard Microsoft C# compiler for C#Builder. The timing effects you're seeing must be due to other reasons (not that I have any suggestions for you on why you're seeing a difference).
Cheers, Julian
Program Manager, C#
This posting is provided "AS IS" with no warranties, and confers no rights.
|
|
|
|
|
[sharp] wrote:
Are you working for Borland ?
He could be but that's ad hominem and irrelevant to the truth or falsity of his claim.
[sharp] wrote:
C# Builder is using csc.exe just like VS.NET
All the more reason why he's asking the question!
Kevin
|
|
|
|