|
I made a UserControl Button. Now I would like to use the Text Property in the Properties Window of the Button inthe Designer to show my Text. I tried with accessors but in my TestForm with my Button is shown "BarButton1" (which is the classname BarButton+1) and not "New" as in the properties window Text-Property.
Does anybody know how to to this?
Stefan
|
|
|
|
|
Expose the button object, ie
public Button MyButton
{
get {return mybutton;}
} This should make it visible via the propertygrid. You might have to add an ExpandableObjectConverter to the property.
Cheers
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Hi!
I think NameVaueCollection can be very usefull at web developement. (HttpRequest.Params )
But, how can I use NameValueCollections Set function. (It always seems to be readonly...)
(Th e other way is the useing the Session property, where i should use)
Agyklon
|
|
|
|
|
|
Hello,
I am working on my first project on C# after coming from C++ and I cannot seem to find out how to write long strings on multiple lines. It seems like
string longstr = "aaaa"
"bbbb";
or
string longstr = "aaaa \
bbbb";
do not work. Of course I can use the + operator, but I don't want to introduce an extra overhead.
Thanks!
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
string longstr = @"aaaa
bbbb";
MyDUMeter: a .NET DUMeter clone "Thats like saying "hahahaha he doesnt know the difference between a cyberneticradioactivenuclothermolopticdimswitch and a biocontainingspherogramotron", but with words you have really never heard of."
|
|
|
|
|
Thanks!
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
Me again!
I tried your solution and of course it works, but when I take a look at the string in the debugger I am not satisfied with what I see. It semmes like my string contains lots of spaces between the last a and the first b. I didn't mean that, all I want is a way the compiler can concatenate my strings....
Best regards,
Alexandru Savescu
P.S. Interested in art? Visit this!
|
|
|
|
|
OK you have this then:
string longstr = "jsandjksajdhakhdkajshd" +
"asmndjashdkashdhaskdhk" +
"asmndjashdkashdhaskdhk" +
"asmndjashdkashdhaskdhk" +
"asmndjashdkashdhaskdhk".
ToString();
Remember C# is freeform.
I rated this article 2 by mistake. It deserves more. I wanted to get to the second page... - vjedlicka 3:33 25 Nov '02
|
|
|
|
|
Hi All
How can I use HRESULT in C# application in order to check the return value from COM method?
Thanks
|
|
|
|
|
|
Thanks a lot
|
|
|
|
|
And of course HRESULT is a simple int in the C# world.
|
|
|
|
|
Hi
I am just starting programing in C# and I couldn't figure out how to do this.
I have a function which returns a single dimensional array. Now I have to call this function 10 times and put this into a double dimensional array.
i did this:
/***********************************************************/
int[,] output = new int[10,100];
for(int i=0; i<10; i++)
output[i] = func(); --- func returns int[100]
/***********************************************************/
But it is giving error that output[i] should have two arguments.
Any help would be greatly appreciated
bart
|
|
|
|
|
You'll need to do something like this...
int[,] output = new int[10, 100];
for (int i = 0; i < 10; i++)
output[i,0] = func();
|
|
|
|
|
output is not a 2 dimensional array. its a 1-dimen. array which happens to be maintaining another 1-dim array.
/***********************************************************/
int[,] output = new int[10];
for(int i=0; i<10; i++)
output[i] = func(); --- func returns int[100]
/***********************************************************/
|
|
|
|
|
What is the proper way to scroll and RTF box when text is entered from network communication?
The app looks something like that following
+------------+
| RTF Object |
| output |
+------------+
| Input |
+____________+
My method has been something like
rtfObject.focus();
rtfObject.ScrollToCaret();
input.focus();
The problem with this is that the input.focus() will select all of the text if you happen to hit the space bar at the same time that it focuses the object. I would rather be able to just get the vertical scrollbar object and set it to max, but I have no idea how to do this.
Thanks,
Steven
|
|
|
|
|
I've been using Managed Directx9 for some time now, and have never resolved one of the first problems I had, and now it's becoming more and more important to see if there is a solution.
It's about dynamic vertex buffering - locking and unlocking, where none of the given solutions provide performance of the unmanaged directx - or I could not find a way.
Locking vertex buffer using two versions of the Lock method that return array is incredibly slow due to the allocation of the new managed array each time lock is called. Somewhat faster is locking with the GraphicsStream - but then setting of the stream is slow.
The fastest way (managed DX samples usually use it) is VertexBuffer.SetData method, however more than a half of it's time is used to execute DXHelp CopyObjectDataToPointer, and I haven't got a slightest clue what the rest of the SetData code looks like.
In my case render method spends 67% time in using SetData and the rest in drawing! And it should be like 10-15% in setting the data, and rest in drawing, like in C++ versions of the similar code.
And there is no unsafe version of the method! Why? I would like to generate my data 'unsafely' and just copy it to the buffer.
This way I generate it, then SetData copies it to unsafe ptr, lock the buffer, copy unsafe data to the buffer, an ulock the buffer, making an excess copy in the process and who knows what else.
It is obvious that in some cases there is more than double performance penality because of this.
Or I am blind to see another way, or somewhere completely wrong?
I'm speaking of the situations like drawing a text or such, where dynamic vertex/index is necessary.
And ofcourse, I have used .Default memory managment and .Discardable lock.
One more thing: DirectX managed demos and tutorials have the same problem and are (sometimes much) slower then their unmanaged counterparts when using dynamic vertex buffering.
I haven't tested DrawUserPrimitives but it's slower and it wouldn't solve my problem - i don't generate vertex buffer every but every 3-9th frame.
Can anyone help?
|
|
|
|
|
Have you asked here:
http://discuss.microsoft.com/archives/DIRECTXDEV.html
|
|
|
|
|
Hi,
I'm trying to open MS Access using OleDbConnection in a windows application but form will just frozen and not continue to the OleDbCommand? anybody knows why please?
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
Sounds like there is a problem connecting to the datasource. I'd say start by checking your connection string.
The word abbreviation is awfully long for what it means.
|
|
|
|
|
but Chris I'm using the same connection string for all my applications and never had a problem plus this application is working perfect on my laptop.
Jassim Rahma
|
|
|
|
|
I'm using the same code in all my other applications and the strange thing that the same application which is giving an error is working on my laptop with no problems:
strSQL = "SELECT * FROM account WHERE department = 'CRM' AND account_pin = '234567'";
// open database;
strConnection = @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=c:\\temp\\Apps\\CRM Queries\\accounts.mdb;Jet OLEDB:Database Password=mem";
OleDbConnection dbConnection = new OleDbConnection(strConnection);
dbConnection.Open();
OleDbDataReader dbReader;
OleDbCommand dbCommand = new OleDbCommand(strSQL, dbConnection);
dbReader = dbCommand.ExecuteReader();
try
{
update_log("validating department and PIN");
while (dbReader.Read())
{
account_department_name = dbReader["department"].ToString();
account_department_pin = dbReader["account_pin"].ToString();
}
dbReader.Close();
}
catch(Exception exp)
{
MessageBox.Show(exp.Message, "Error");
}
finally
{
dbConnection.Close();
}
Many Thanks,
Jassim Rahma
Jassim Rahma
|
|
|
|
|
Not having much luck creating messages and changing the sent date/time for archiving imported messages from Notes to Exchange.
I'm not having much luck getting hints on how to do this from any boards or newsgroups either.
Does anyone here at CP have any experience doing this in C# or with any other language for that matter?
Thanks bunches.
|
|
|
|
|
Hello,
How does a service control manager (or operating system) know that a windows service did not start successfully? Should I throw an exception in the overriden OnStart function? Or is there some other way? Thank you in advance!
Rado
|
|
|
|