In Your control which is too added class;- Declare delegate:- public delegate void ShowTextEvent(string str,EventArgs e); Declare event:- public void ShowTextEvent MyEvent; ///////////////////////////////////////////////////////////////////// void somemethod() { //////////////////////////////// Control is added Controls.Add(NewControl); /////////////////////////////// Setting Event to this. NewControl.MyEvent+=new ShowTextEvent(OnMyEvent); } ////Handler void OnMyEvent(string str,EventArgs e) { }
Aslam Bari
Posts
-
Create events for windows User Control.Urgent!!! -
shList View is not getting clearedHello All, I have a user control. which contains a tree view as well as list view control. One at a time will show. I have problem with ListView. I am adding item in at runtime on OnDraw method. I have also override OnMesureItem. Now i want to clear the the item. But there is some problem with it. When i click on submit button, old items should cleared and new ones should be added. But when i click on submit button. The new items added to the list , they are not getting cleared. I used:- Item.Clear(); Can anybody help me.
-
Problem With ListBox Horizontal ScrollbarThanks Nader, My Problem has resolved. I was not using HorizontalExtent. Now i realize this is important property. So very very thanks. Now I have a samll question too. What is the easiest way to give a shortcut key to a Button in C#. Like Ctrl+S or F6 etc. Thanks...
-
Problem With ListBox Horizontal ScrollbarDear all, I have add a listbox with following property on listbox1.DrawMode=OwnerDrawVariable; listbox1.HorizontalScrollbar=true; listbox1.ScrollAlwaysVisible=true; I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine. Please help.
-
ListBox Horizontal Scrollbar ProblemDear all, I have add a listbox with following property on listbox1.DrawMode=OwnerDrawVariable; listbox1.HorizontalScrollbar=true; listbox1.ScrollAlwaysVisible=true; I am overriding the DrawItem event of the ListBox for drawing item's text. Some text are too big to fit in the list box. But the Horizontal Scrollbar is not enabled or working. Horizontal scrollbar is visible and [disable or dim]. Vertical scrollbar is working fine. Please help.
-
How to give keyboard shortcut to Command ButtonDear all, I am trying to find the easiest way to give a keyboard shortcut to a command button like CTRL+K or F9 etc. Can i also give the shortcut key to ToolStripButton? How? Thanks...
-
ListBox With TreeDear All, I am showing some thumbnail pictures in a listbox. Thumbnails have category. Now I want to show tumbnails category wise in ListBOx. So that i can expand or collapse each category to see thumbnails like tree view. Have anybody some idea about it?
-
ZoomingDear all, Does any body know how to control Zooming in ObjectArx written in C#. Actually I am programatically selecting a Object in Autocad. Now i am issuing a Zoom command from C# - objectarx library. But this zooms the object very big(entire screen). I want to control this zooming, means decrease this. How can I decrease the zoom level. Thanks...
-
Problem with uploading with image + text box fieldThere are many alternate ways:- I am not sure why that is not working. If you still want to show something on next page try one of the followings:- 1. I am not sure but on the next page FILE[] method will be available 2. Use Session Variables to store what you want in textbox 3. Added the variable to QueryString ? 4. Use database query to show information on next page.
-
HTTP/1.1 500 Internal Server Error?It May be the problem of your FireWall, Plz see Is your fire wall has blocked this application?
-
problem displaying records in order of time and date in phpTry it, select * from logdisplay order by Timestamp DESC
-
ComboBox mouse selectionHello Everybody, I have already asked this question but no body given me response, i am repeating the same problme:- I have made a user control, then add a panel on it and add a combobox on the panel. The whole user control then i added at runtime to a Autocad Pallete. But when i want to select an item from the combobox it hides the menu. But i am able to select the item from keybord. What is the problem with mouse? Thanks...
-
Call to unmanaged dll functionDoes anybody know what is the problem in the below code. The InPtr returned by the funcion is always 0 means null. Why? //////////////// public class ThumbnailExtractor { [System.Security.SuppressUnmanagedCodeSecurity] [DllImport("acdb17.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "?acdbGetPreviewBitmap@@YAPAUtagBITMAPINFO@@PB_W@Z")] extern static private IntPtr acdbGetPreviewBitmap(string filename); static Bitmap GetBitmapFromDwg(string filename) { return Marshaler.BitmapInfoToBitmap(acdbGetPreviewBitmap(filename)); } public Bitmap GetImage(string filename) { return GetBitmapFromDwg(filename); } } /////////////////// Thanks in advance
-
How do I manage the checkonClick/uncheck on a menu itemTried It out and worked fine. private void m_SortItem_Click(object sender, EventArgs e) { //Clearing check marks from all menu items foreach (ToolStripMenuItem item in sortToolBtn.DropDownItems) { item.Checked = false; } //Selected the current item which is clicked. m_SortItem.Checked = true; }
-
list boxDear Sivamyneni, Currently i don't know the problem with DataSource, i think at a time we can add only one datasource. I also couldn't find the listbox.DataBind() and listbox.DataTextField. What version of .NET u r using. By the Way an alternate way i am giving here and try it.. //Connection to database OdbcConnection con = new OdbcConnection("DRIVER={MySQL ODBC 3.51 Driver};server=localhost;database=mysql;uid=root;pwd=mysql"); con.Open(); //Get data from user table OdbcDataAdapter ad = new OdbcDataAdapter("select * from user", con); DataSet set = new DataSet(); ad.Fill(set); //Here is the code to add all the items of the first column of the user table. foreach (DataRow row in set.Tables[0].Rows) { listBox1.Items.Add(row[set.Tables[0].Columns[0]]); } ////ON OTHER EVENT LIKE CHECKBOX OR BUTTON CLICK REPEAT THIS. OdbcDataAdapter ad = new OdbcDataAdapter("select * from BILL", con); DataSet set = new DataSet(); ad.Fill(set); //Here is the code to add all the items of the first column of the bill table. foreach (DataRow row in set.Tables[0].Rows) { listBox1.Items.Add(row[set.Tables[0].Columns[0]]); }
-
ComboBox mouse selectionYes i checked it again. First i have made a usercontrol, then i make a panel on it, then i put all the controls on that. But these all controls (Complete user control), i am adding at runtime on a Autocad Pallate. Problem still exist? Thanks,
-
list boxHi sivamyneni, I think when you select one class , the result come in the list box. but when you select the second class , the previos result disappear and the new one shows. I am not sure what method you are using for adding in the list box. Before adding items in the list box , be sure, you should not clear the list. You have to append or insert into the list. If problem not solved, than show the code to me.
-
ComboBox mouse selectionRespectfully, First I have added a UserControl, then i have added a panel on it and on the panel i have added a combobox. But on run, when i want to select an item from combobox , it autohide the list. I can select the item by typing. When i click the dropdown button it opens the list. but when i try to select an item. The list get collapsed. Plz solve the Problem. Thanks.
-
Objectarx with c#How can I open a file in Autocad available on http://server using c# program.? How can I savd a file in Autocad on http://server using c# program.? How can i use the Stream in Autocad(file open and save using stream) in c#?