|
i have tried to do that using region and mouse events but im having error regarding region class.....
Brijal Patel.
|
|
|
|
|
Well, it's hard to know what you're doing wrong if you don't post the code.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
sorry im nt having code at this time.... It's at my working place...
Let me exaplain u the problem briefly,
Windows form is my canvas... i hv written code to draw a rectagle at runtime using mouse.... now suppose i have drawn 2 -3 rectangle...
now i want to resize the previously drawn rectangle... for this problem i hav tried to use region class to check whether mouse click point is on specific rectangle or not..... but im havin problem with those stufs.........
if u can help me out to write the code how to select that rectangle again n resize....
Brijal Patel.
|
|
|
|
|
When you're at work, post your code, then I can tell you what is wrong with it.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am using VB2005 to write an addin for Autodesk Inventor 2008, and I am having trouble understanding one part of the code that I have seen is some sample addin's posted by Autodesk.
When an addin loads it gets access to the running instance of inventor, thru an Activate method.
Public Sub Activate(ByVal addInSiteObject As Inventor.ApplicationAddInSite, ByVal firstTime As Boolean) Implements Inventor.ApplicationAddInServer.Activate
' This method is called by Inventor when it loads the AddIn.
' The AddInSiteObject provides access to the Inventor Application object.
' The FirstTime flag indicates if the AddIn is loaded for the first time.
' Initialize AddIn members.
m_inventorApplication = addInSiteObject.Application
When I create a form in the designer I believe I want to access this same running instance, so I declare a variable. How do I assign the invApp variable the same inventor application from the Activate method?
I feel there is something very basic here that i am missing.
Imports Inventor
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim invApp As Inventor.Application
End Sub
End Class
If anyone can answer or direct me to something that will help me understand this.
Greatly appreciated
|
|
|
|
|
warped208 wrote: m_inventorApplication
this is a member variable, you should access it directly from your form. I see no reason for it not to be static, there will be only one.
Christian Graus
Please read this if you don't understand the answer I've given you
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I have a datagridview. I want to allow users to right click on any record. When they right-click, they will get options like Add/Delete...etc.
Can you provide a sample code or external link to an example in c#?
|
|
|
|
|
Hi,
In order to achive the desired behavior you need to add ContextMenuStrip on the form. Then you need to add the MenuItems for the context menu and write code for the respective MenuItem (i.e., for Delete or ADD). Then you can attach the ContextMenuStrip to your grid on FormLoad (or any other event as per your requirement) in the following manner:
BEGIN CODE
this.dataGridView1.ContextMenuStrip=this.contextMenuStrip1
END CODE
I hope this helps .
Regards,
John Adams
ComponentOne LLC
|
|
|
|
|
have a textbox and in that i want to disable copy paste option of the user in window application using vb.net. Please let me know the solution
|
|
|
|
|
You will need to handle keyboard events such as KeyDown/KeyUp and/or KeyPress. In the event handlers check if ctrl+v or ctrl+c is pressed. You will also need to make sure that user can't open context menu of the textbox.
Giorgi Dalakishvili
#region signature
my articles
#endregion
modified on Monday, March 24, 2008 3:37 AM
|
|
|
|
|
Hi,
I have a MDI application and I want to get the child form which is currently in focus/on top/being used.
I've tried using logic like this to loop through all the MDIChildren:
<br />
array<system::windows::forms::form^>^ children = this->MdiChildren;<br />
for each (System::Windows::Forms::Form^ form in children){<br />
if(form->TopMost){<br />
System::Windows::Forms::MessageBox::Show(form->Text->ToString());<br />
}<br />
}<br />
</system::windows::forms::form^>
but it doesn't work.
|
|
|
|
|
I guess you should access the form's Active proprety
|
|
|
|
|
What you're looking for is the ActiveMdiChild[^] property of your MDI parent form.
|
|
|
|
|
Hi,
I have to run a C# windows service in .net in which i have to generate popup message box reminder every one hour. i dont want to run it as a application, as each and every time we have to run it manually daily. i cant find a message box in windows service. can anybody please give me an idea of how to do it in an automatic service so that no manual process should be done. once they switch on the system, the service should start automatically and should generate popups once an hour. Pls help.
Thanks and Regards
Vijayarajan.V
|
|
|
|
|
Erhm, too bad... You have to find another solution... A Windows Service does not support a GUI. You may want to develop a diffrent application which does support GUI (WinForms app.) and start start using the Process.Start() method from your service.
|
|
|
|
|
Maybe, just maybe, you can program something like a NET SEND command ? That shows 'like' a messagebox.
|
|
|
|
|
Hi All,
I have an winform control which needs to be hosted in a aspx page. Iam using the <object> tag do so and its working. When an event occuers (like tab click) on the IE hosted winform control i need to raise this event to the aspx page which hosted the control.
Any sort of help is appriciated. Thanks in advance.
Regards
Pani.
|
|
|
|
|
Kodanda Pani wrote: i need to raise this event to the aspx page which hosted the control.
I don't think this is possible.
|
|
|
|
|
Why on earth are you using this architecture? It's just plain daft.
If you need a control, you should write it as an ASP.NET control - they are very easy to write - and more importantly they sit neatly in the whole HTTP pipeline, so they can easily raise events that the host can interact with.
|
|
|
|
|
I am trying to get the position of the scoll bar in a rich text box.
I am calling the following method:
[DllImport("user32")] public static extern int GetScrollPos(IntPtr hwnd, int nBar) ;
Like this:
public const int SB_VERT = 1;
int pos = GetScrollPos(rtb.Handle, SB_VERT);
where rtb is a RichTextBox
If the form containing the rich text box does not have focus, this gives me the scroll position accurately. If the form does have focus, it gives me an inaccurate result. For example, if I scroll to the top of the rtb, and the form does not have focus, this returns 0.
But if the form has focus, this always returns a value which indicates the rtb is scrolled to the bottom (regardless of where the scroll actually is).
Anyone know why this happens, or how to work around it?
Thanks
|
|
|
|
|
hello every body
iam looking for J# statement equivlant to this C# one
datagridview1[j,i].Value
where j,i are the row and coulmn indexes
thanks in advance
|
|
|
|
|
mr.me wrote: iam looking for J# statement equivlant to this C# one
You are looking for it?
Get a beginners book or take a university course.
led mike
|
|
|
|
|
You do know that J# is a dead product, right? MS will support it until 2015(?), but there will be no further development on the language and you won't see it in future versions of the .NET Framework or Visual Studio.
|
|
|
|
|
Dave Kreskowiak wrote: do know that J# is a dead product
Yep, and never even bothered to look at it
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Hi,
AFAIK Java uses the array-of-array notation, as in arr[i][j] .
And IIRC they don't have indexers nor properties: in your statement, datagridview1
is presumably a DGV, not an array, but the indexer capabilities of C# allow you
to access its internal data as if the object itself were an array.
And properties represent code (a getter and/or setter method) that shows up as if
it were a data member.
So in the end you may well end up writing something like datagridview1.GetValue(i,j)
for a class that then needs to have a GetValue() method.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|