|
|
Hello,
I am trying to retrieve the Index property of a row in the SelectedRows collection (Managed C++, .Net 2.0).
lRowIndex = pSelectedRows[idxSelectedRow]->Index;
I get -1 value, and I suspect this is because of shared rows.
Still, I need to know the row index. How can I find it ?
On the other hand, the same code works well if the SelectedRows is passed as data in a DoDragDrop operation (maybe then, shared rows are not used).
Thank you,
Cristian
|
|
|
|
|
The approach I was trying was the correct one: to retrieve row index you may use
lRowIndex = pSelectedRows[idxSelectedRow]->Index;
I was failing to get correct values not because of the shared rows, but because of the fact that I was altering the "selected row" data in a previous set of CurrentCell DataGridView member. Now I corrected it and everything works fine, so this topic may be closed. Thank you.
|
|
|
|
|
Hi Guys,
I have a .net application, in which a frequently used screen experience a GDI leak. Using GDILeakDetector, i found the kernel address of the bitmap object, which is causing the leak.
Handle : 0x3a0509ea
ObjectType : Bitmap
Kernel Address : 0xe2cc9d28
Extended Information : Width: 12, Height: 12 , Bits/Pixel: 32
Now i need to find out what is that object in the screen (i.e) object details, from the kernel address. Can u pls help me out in this how could i point out the object in the screen and also how to dispose it on form close.
Thanks in advance
|
|
|
|
|
Search for every use of the Bitmap class and ensure that the object is always disposed when you've finished using it. If, for example, you allocate a bitmap in a method and you assign it to a local variable (not a member variable of the class), use a using block to ensure it's disposed of automatically.
If you assign it to a member variable of a class, for example a Form, then you should override the Dispose(bool) method and when the parameter is true (to indicate disposing rather than finalizing), call Dispose on the bitmap. The Framework will call the Form's Dispose method when the form is closed. Visual Studio automatically generates an override of Dispose which you will find in the Designer file (e.g. MyForm.Designer.cs) in VS2005 and later.
(It is not safe to call Dispose on member variables when Dispose(bool) is being called by the finalizer, because the order in which finalizers are called is essentially random. The Bitmap may already have been cleaned up by its own finalizer.)
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
I'm currently learning C# and WinForms and practicing on Visual C# 2008 Express Edition.
I wanted help regarding the look and feel of menuStrip and toolStrip controls - they have a blue Office 2003'ish look and feel; I want them to look native on XP (or Vista). How can I do that? Thanks..
|
|
|
|
|
Other than the fact that .NET 2.0+ has many different styles for menu items (the RenderMode property of menustrips can be set to System and that will allow the appearance to change with the OS visual style). If you want to customize the menustrips beyond that aspect, you may consider looking at one of my articles on custom toolstrip renderers: Custom ToolStrip Renderers[^]
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
|
Do you have the visual styles enabled in your entry point? E.g:
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new Form1());
}
Semicolons: The number one seller of ostomy bags world wide. - dan neely
|
|
|
|
|
Yes, I checked that part. It was enabled. Sorry I didn't reply; I had to change the RenderMode as suggested by Thomas..
|
|
|
|
|
Hi,
I m getting the following error while i m trying to place the UserControl from ToolBox to Form.
Failed to create component 'ResizedUserControl'. The error message follows:
'System.Reflection.ReflectionTypeLoadException: Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.
at System.Reflection.Module._GetTypesInternal(StackCrawlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at Microsoft.VisualStudio.Shell.Design.AssemblyObsoleteEventArgs..ctor(Assembly assembly)
at Microsoft.VisualStudio.Design.VSDynamicTypeService.ReloadAssemblyIfChanged(String codeBase)
at Microsoft.VisualStudio.Design.VSDynamicTypeService.CreateDynamicAssembly(String codeBase)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.get_Assembly()
at Microsoft.VisualStudio.Design.VSTypeResolutionService.AssemblyEntry.Search(String fullName, String typeName, Boolean ignoreTypeCase, Assembly& assembly, String description)
at Microsoft.VisualStudio.Design.VSTypeResolutionService.SearchProjectEntries(AssemblyName assemblyName, String typeName, Boolean ignoreTypeCase, Assembly& assembly)
at Mic...'
How to overcome this?Any Solution plz....
Thanks in Advance..
|
|
|
|
|
I have a similar problem. This question was asked in 2008 and no one ever replied. Searching web does not find an answer either.
Working backward I found that when you use a parameter "this.Text" or anything with "this" you cannot add it from the Toolbox. The control works as expected with each instance of the tool working from its own parameters. You can copy and paste it with out problem with out problem. You just cannot get it from the Toolbox.
So many years of programming I have forgotten more languages than I know.
|
|
|
|
|
I wanted to have button through which user can copy the [order details] from one order id to anoth order id. For example order id: 10248 have 10 detail item and I wanted all these items to append in order id: 200.
My problem is that below mentioned code is copying the detail items but it also removes the source detail record. Any clue!
--------------------------------------------------------------------
Private Sub btnCopyOrderID_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCopyOrderID.Click
Dim DataTable2 As DataTable = New DataTable
DataTable2 = obj.GetDataSet.Tables(1).Clone
'
' copy required record into a new table: DataTable2
For Each MydataRow In obj.GetDataSet.Tables(1).Select("OrderID = " & xcopyOrderID.Text)
DataTable2.ImportRow(MydataRow)
Next MydataRow
'
' change order id in DataTable2
For i = 0 To DataTable2.Rows.Count - 1
DataTable2.Rows(i).Item("OrderID") = OrderID.Text
Next
'
'paste records from DataTable2 to Original Table
For Each NewdataRow In DataTable2.Rows
obj.GetDataSet.Tables(1).ImportRow(NewdataRow)
Next NewdataRow
End Sub
|
|
|
|
|
Hi there,
When I have thrown nil-Exceptions with the MOF then any iteration requested is about empty data.
Struct
Real
Nil -> repeated
Dave
|
|
|
|
|
Hi,
I need to create an executable in c# which unchecks the "Automatically Detect Settings" checkbox in Internet Explorer Options, LAN Settngs.
Any Help?
Thanks
|
|
|
|
|
hi all,
i'm sending mails by using smtp server ,code is executing but the mails are not going and that mails are there in mail queue and bad mail in mailroot folder .
can any one tell me what is the problem ....
thanks ,
CSN
|
|
|
|
|
Hi
I have a winform control which has a text box with certain text in it. I save this and export this on a .aspx page the text size increases. How can i get a consistent text size in both the winform and the aspx page?
Thanks and regards ananth
modified on Wednesday, May 14, 2008 8:01 AM
|
|
|
|
|
By setting the font size in the aspx and praying that the user has the same overall font size set as you do.
You cannot guarentee 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 )
|
|
|
|
|
Hi
he he thanks grauss but the default font size of the text box is 8.25. I would like to change the font size could u plz tell me how this is done... and also i would like to avoid the decimal part i.e when a user specifies the font size i do not want him to selct 9.3 etc or how can i round the decimal part?? Hop i did not confuse u..
Thanks and regards
ananth
|
|
|
|
|
Hi,
Currently i'm working with corel design . I want to consume corel dll into my application and i want to use corel dll methods. If anyone has knowledge on this please help me.
Thanks in advance.
Sekhar Reddy
|
|
|
|
|
If it's not a COM dll, you can use p/invoke to call it's methods.
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 )
|
|
|
|
|
Thanks christian. Can you explain clearly what are the steps we need to follow to invoke the dll and it's methods.
Thanks and Regards,
Sekhar Reddy
|
|
|
|
|
www.pinvoke.net shows how to do it for win32 API stuff, you write code that imports the method from the dll and then call that from C#
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 )
|
|
|
|
|
Thanks christian i will try with this.
~ Raja Baireddy
|
|
|
|
|
HI All,
I am using VS03 + c# + Winforms.
In my application , if i select English language then all the lables of the forms should be in english.
If i check language as italian then all the labels should be in italian.
Or i can check any name of language.
So i want the multiple language support for my application.
HOw can i do this?
Procedure in c# Is appriciated.
Thanks in advance.
|
|
|
|