|
hi,
I am added property to my class which is inherit form Control.I set to that property attribute
System.ComponentModel.Browsable ,but I can not see my property at Design time. Is somebody tell me how should I fix it.
Hare is my property:
[System.ComponentModel.Browsable(true)]
public string Alabala
{
get
{
return alabala;
}
set
{
alabala = value;
}
}
|
|
|
|
|
Stop double posting
// Steve McLenithan
Cluelessnes: There are no stupid questions, but there are a lot of inquisitive idots.
|
|
|
|
|
hi,
I am added property to my class which is inherit form Control.I set to that property attribute
System.ComponentModel.Browsable ,but I can not see my property at Design time. Is somebody tell me how should I fix it.
|
|
|
|
|
From the API docs:
"Control does not have any user interface (UI) specific features. If you are authoring a control that does not have a UI, or combines other controls that render their own UI, derive from Control."
This means that there is no inherent UI aspect to a generic Control. Therefore, there is nothing to see at design time. What you need to do is derive your class from a control that already has a UI element to it. Something like System.Web.UI.WebControls.Panel or System.Windows.Forms.Panel (for a web app and windows forms app respectively) would work well in this case.
Hope that helps.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi
i am using an OdbcDataReader. But i can't read the fields, except the 0. field. I get "system.nullreferenceexception".
my code is like below:
this is working:
MessageBox.Show( objOdbcDR.GetInt32(0).ToString() );
this is throwing the exception:
MessageBox.Show( objOdbcDR.GetString(1) );
does anyone know why?
thanks.
Ozgur Nevres
|
|
|
|
|
Does your SQL query select more than one column?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
You did call OdbcDataReader.Read before making any calls, didn't you?
BTW, it's hard to know what to ask to diagnose the problem because you gave very little information. Perhaps some surrounding code (from getting the OdbcDataReader to closing it) would be more helpful. The problem is most likely not with the immediate statement that throws an exception.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi guys,
I'd like to know how to paste OLE document in RichTextBox giving the ability to the user to choose if to paste it as icon, as formatted contents (i.e. word, excel,...) or link.
thanx
tommaso
|
|
|
|
|
There's a good article on this site about taking control over COM objects, images, etc inside RichTextBoxes. I suggest a search of the articles.
The graveyards are filled with indispensible men.
|
|
|
|
|
Hi there,
how can i display an existing (local) html file in a WebBrowser window (without any buttons)?
The html file should just be displayed in this window - that´s it. But i don´t know how to do it...
Greetings,
Stefano
|
|
|
|
|
- Create a new Form
- Set the FormBorderStyle of the form to FormBorderStyle.None
- Set WindowState to WindowState.Maximized
- Place a WebBrowser control on a form
- Set Dock to Fill
- Show the form, call WebBrowser.Navigate
You should see the html file and nothing else. No buttons, no form borders, no File->Exit menu.
|
|
|
|
|
Whicht parameters do i need to fill this method? I just have the html filename, e.g. test.html.
Kind regards,
Stefano
|
|
|
|
|
StefaNeo wrote:
Whicht parameters do i need to fill this method? I just have the html filename, e.g. test.html.
<code>Object o = null;
string url = "[FullPathToYourFile]";
this.webBrowser.Navigate(url, ref o, ref o, ref o, ref o);</code>
-Nick Parker
DeveloperNotes.com
|
|
|
|
|
It works, but you can make it cleaner with Missing.Value:
object empty = System.Reflection.Missing.Value;
string url = "....html";
webBrowser.Navigate(url, ref empty, ref empty, ref empty, ref empty);
|
|
|
|
|
Hi,
I'm working on automated software tests with c#. As long as I stick to windows controls, everything is fine. But I now need to use the Active Accessibility functions as well (for webtests, Flash based software and so on)
The (rare) documentation I found on the topic is only for c++, and I just can't figure out how to use it correctly in c#. How do I correctly implement functions like AccessibleObjectFromWindow which uses severa pointers ?
has anyone already gathered some experience with it, or do you know where I could find relevant c# information on the topic ?
thx a lot
Ulf
|
|
|
|
|
I'm not sure about other people but I don't even know what "Active Accessibility" functions are. If what you are using is a COM component, then you can simply add a reference to it in your C# project (assuming the component has been registered on your system). If it's not a COM component, then you're going to have to give us more details.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi Matt,
Active Accessibilty (MSAA) has originally been developed to help people with disabilities to use software.
Beside this great idea, Active Accessibility allows you also to get info on windowless UI controls, or perform actions on them (e.g. buttons or textfields in Flash animations)
In C# I found the AccessibleObject class, which seems pretty much to be what I'm looking for (I'm writing automated software- and webtests).
My problem is, that I don't know how to use it on controls or windows in external software. C++ usually uses the AccessibleObjectFromWindow API to get an IAccessible Interface pointer to a window. Unfortunately, I don't know how to use this function in c#.
If you have any hint where I could look.....
thx,
Ulf
|
|
|
|
|
I think I understand a little better. What you mean by external software is basically programs that you don't have the code for. Is that correct?
Do you already have a way to get a handle to the window in question? If so, then you should be able to just use it. However, if you don't have a handle to the window in question, you need to read up on API Hooking and window subclassing. This is not a simple topic and you should consult the various articles on CP that address it.
Now, if I've still not hit on what you are looking for, then I think you need to clarify further. If it's knowing how to use your Active Accessibility API, I can't help you there, you'll have to just read the docs.
Here is an article on CP that talks about hooking in a browser using C#: http://www.codeproject.com/jscript/htmlgetshooked.asp?target=api%7Chooking%7CC%23. Take a look at it and maybe you'll be able to get a little farther.
Good Luck,
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
Hi all:
I have a picturebox, and I want to dynamically show the selecting rectangle when I press mouse down and moving on the it.
How to do it?
|
|
|
|
|
One way to do it is to render the rectangle on a backbuffer each time the mouse is moved. This way you don't have to worry about erasing the rectangle properly.
Another way is to use the ControlPaint.DrawReversibleFrame() method, and erase the old rectangle by redrawing it before you draw then new rectangle.
|
|
|
|
|
Hi,
I am doing a multi threaded app using C#,i have 4 thread spanned for a particular task(searching a Central Reservation System),one of these 4 may take a long time and which affects over all performance of the search.
So wht should be done in this case,should the thread which is waiting for along time be killed and spanned again?? is it a good thing do be done.
Pls advice
TIA,
Sudheer.
|
|
|
|
|
You're not really providing much for us to go on here, but I'll give it a shot. I'm assuming that your 4 threads are reading data from the same data source so the first question is are you properly synchronizing access to that data source? Second, it seeems strange to me that one of your threads is taking longer than the others to complete its task. It sounds like you might have a Race Condition. Make sure that you are properly synchronizing access to your data source and that you're not letting two threads have the same exact data object to process (or use the same database resource simultaneously if your threads are accessing a database).
Good luck.
-Matt
------------------------------------------
The 3 great virtues of a programmer:
Laziness, Impatience, and Hubris.
--Larry Wall
|
|
|
|
|
I am process text files, opening parsing copying, deleting all base don what is inside.
I am running into to file contention at different points. I am using FileInfo objects to move, copy and delete the files. I believe it is the file Info object that is not releasing the file. I have even place the different file info object in different classes, methods hoping that when the fileinfo went out of scope it would release the file. Is there a release method that can be called to ensure the file info object lets go of the file?
Thanks
David23g
david23g
|
|
|
|
|
I don't see how. FileInfo doesn't acquire a file handle which means the file isn't opened. It uses Win32's FindFirstFile API which gets information based on the file without opening - basically information that is stored in the filesystem for that file's record.
I would make sure you're closing all your streams. The best way to make sure of this is:
Stream s = null;
try
{
s = new FileStream(...);
}
catch
{
}
finally
{
if (s != null) s.Close();
}
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|