WPF Equivalent To ActiveControl?
Jan 29, 2010
In Forms, I can simple use ActiveControl.name to get the name of the active control. However in WPF this doesn't work. What is the WPF command equivalent to Activecontrol.name? I'll take C# or VB, either way.
View 1 Replies
ADVERTISEMENT
Dec 2, 2009
I have multiple control in the form. 10+ textboxes, 2 comboboxes. These controls will change their back color when get focus. I don't want to use control arrays and I don't want to write in multiple GotFocus/LostFocus. The only idea I have is, checking wheather Me.ActiveControl has changed or not from a timer.
View 2 Replies
Oct 11, 2010
On Windows Phone 7 to get the current control one would use
FocusManager.GetFocusedElement()
Wherea on Winform it is just ActiveControl.Why use 2 semantics which is a nuisance for portability ? Is there any difference of behavior you can see between the two ? If yes that makes sense, otherwise that doesn't.
View 2 Replies
Oct 14, 2010
I know that AndAlso is equivalent to && and OrElse is equivalent to ||. But what is the cleanest way to achieve the equivalent of Visual Basic's And and Or in C#?For example, consider the following VB.NET code.The ValidateForControl method performs some validation and returns whether the state of the specified control is valid. The entire input form is valid if all controls are valid. However, each control must be individually validated even if one is invalid (which requires the operator not to short-circuit). Visual Basic's And operator is perfect for this situation, but unfortunately there's no equivalent operator in C# as far as I know (&& short-circuits).
[Code]...
View 6 Replies
May 24, 2012
I am Validating a TextBox on it's KeyPress Event in VB.
VB.Net
If InStr("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz`~!@#$%^&*()_+|[]{};:<>/?,.'" & """" & Chr(8), Chr(KeyAscii)) = 0 Then KeyAscii = 0
What will be it's equivalent in C# ?
View 3 Replies
May 18, 2012
Let me know how can i use this Err in c#.This is VB Code:
If Len(sPart1) <> PART1_LENGTH Then
Err.Raise(vbObjectError, , "Part 1 must be " & PART1_LENGTH)
[code]......
View 4 Replies
Jul 14, 2011
What I am trying to do is to check if a value matches one of two numbers (and easily be able to add to the numbers to compare to). Rather than doing a longer-winded way such as: [Code] I have found that this only works when SectionID is 2 or PageID is 8. If SectionID is 3 or PageID is 12 then it doesn't work. Why is this and what can I do to try to get around the problem?
View 3 Replies
Sep 1, 2010
what is the equivalent for OLE in .net
View 1 Replies
Jan 20, 2011
I'm normally at home in C#, and I'm looking at a performance issue in some VB.Net code -- I want to be able to compare something to the default value for a type (kind like C#'s default keyword).
[Code]...
View 3 Replies
Mar 20, 2012
I am relatively new to Visual Basic. When it comes to logging, in Java I use log4j for logging.What is the equivalent in Visual Basic and can you please guide me to a good tutorial?
View 1 Replies
Jul 28, 2009
private bool txtRegExStringIsValid(string textToValidate)
{
Regex TheRegExpression;
string TheTextToValidate;
[code]....
View 2 Replies
Jul 17, 2011
I've got a large codebase which I'd like to expose to plugin authors to allow them to use VB.Net Express to code plugins for a server app, which is not available to them. My problem is that even with obfuscation, I'd rather not distribute the complete app and/or dlls, as even with obfuscation peeling apart a .NET assembly and puzzling out code is relatively easy to do. I'm interested in this because the licensor I obtain the code from requires me to protect IP and assets and while distributing .NET apps opens up the app to disassembly, keeping the server app private and allowing users to utilize a skeleton dll to code against is a happy medium.
What I'm looking for is some way or a utility to go through my server app source code and create a codeless version of the app which only contains method and property signatures.The intent is to provide a stub .NET dll for them to add as a reference and code against as if they were directly interacting with the server, without actually providing the server code to them, compiled or not. I can of course do this by hand but there are over 90 classes and hundreds of thousands of lines of code I'd rather not spend a week hand tweaking. Also, this presents a problem whenever new methods or code are added to the project. Finally, two separate projects is an even worse scenario.Because people will post suggestions that have little or nothing to do with the question, here's a short, clear example. I want to turn this class:
Public Class MyServer
Public ReadOnly Property Name() As String
Get
Return "Whatever"
[code].....
View 2 Replies
Jan 10, 2012
What is the vb.net expression of this c# expression ?
Frame.GetController<ShowNavigationItemController>().CustomShowNavigationItem += new EventHandler<CustomShowNavigationItemEventArgs>(WindowController1_CustomShowNavigationItem);
View 4 Replies
Nov 16, 2011
I'm looking at some old ASP code that contains the following:
Set objDSE = GetObject("LDAP://RootDSE")
Set objSysInfo = CreateObject("adsysteminfo")
Set objUser= Getobject("LDAP://" & Replace(objSysInfo.UserName,"/","/"))
dtmValue = objUser.PasswordLastChanged
[code]....
This is for an intranet app that uses integrated authentication. Is there a replacement for the ASP adsysteinfo object? I can probably port most of the LDAP calls using System.DirectoryServices.DirectoryEntry, but is there a better/easier way to do this in ASP.NET (VB.Net or C#)? how to convert the ASP object properties to DirectoryEntry properties?
View 1 Replies
Aug 2, 2009
I have made an application in vb6 abd now trying to do the same in visual studio 2005. In vb6 i was using MSFlexgrid and its .Textmatrix properties. Would like to know what is the .Texmatrix equivalent for .net. When i pasted the code form vb6 i get the following error...
'TextMatrix' is not a member of 'AxMSFlexGridLib.AxMSFlexGrid'
View 6 Replies
Jul 11, 2011
Is there an equivalent to C#'s MVC [Bind(Include="Title,Description")] in VB?
View 1 Replies
May 10, 2012
What is the equivalent of Program.cs in VB.NET WinForms application?I need to move my .CS app to VB.NET.
As I do not have forms in my WinForms project in Program.cs I do the following:
Application.Run(new MyForm(parm1, parm2);
How to move this code in VB.NET?
View 2 Replies
Aug 4, 2010
In .net (c# or vb) expressions, how would you implement SQL's handy IN() functionality?i.e. value in (1, 2, 4, 7)rather than:
value = 1 or value = 2 or value = 4 or value = 7
There are obviously many ways, I'm looking for the most clean and simple!
View 7 Replies
Jul 8, 2009
Possible Duplicate: How do I specify the equivalent of volatile in VB.net? What is the VB.NET keyword equivalent of C# "volatile"? If there is no keyword what mechanism is the equivalent?
View 4 Replies
Jul 27, 2011
I do not know anything about PHP or Wordpress. But I was told Wordpress is very cool to use with PHP.
I use ASP.NET and would like to have a CMS for ASP.NET.
What is the best CMS to use for ASP.NET when cost is not an issue?
View 1 Replies
Apr 21, 2010
Does C# have an equivalent to VB.Net's DirectCast?I am aware that it has () casts and the 'as' keyword, but those line up to CType and TryCast.To be clear, these keywords do the following;CType/() casts: If it is already the correct type, cast it, otherwise look for a type converter and invoke it. If no type converter is found, throw an InvalidCastException.
TryCast/"as" keyword: If it is the correct type, cast it, otherwise return null.DirectCast: If it is the correct type, cast it, otherwise throw an InvalidCastException.
EDIT: After I have spelled out the above, some people have still responded that () is equivalent, so I will expand further upon why this is not true.
DirectCast only allows for either Narrowing or Widening conversions on inheritance tree, it does not support conversions across different branches like () does.ie: C#, this compiles and runs:
//This code uses a type converter to go across an inheritance tree
double d = 10;
int i = (int)d;
[code]....
View 10 Replies
Feb 19, 2010
i didn't want to trust this one to any number of online conversion websites that I often use.I don't need to convert the declarations, just the expression '(byte)((flen & 0xff00) >> 8)'in
byte[] sendFrameData = new byte[280
ushort flen
sendFrameData[7] = (byte)((flen & 0xff00) >> 8);
View 2 Replies
Nov 3, 2009
I want to progammically close a form, in VB 6 I used Form_QueryUnload 0, 0, on VB.Net (2008) MyForm_Closing 0,0 doesn't work?
View 4 Replies
Nov 24, 2010
The code in C# is as follows:private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
[Code]...
View 3 Replies
Mar 30, 2009
im using a quesry which returs the max value from a table the issue is the line cmd.ExecuteScalar() may return a value null if there are no records , is there any eway to chk if value returned is null or not?
View 2 Replies
Sep 18, 2008
As I understand it Context menus are meant to replace the Popupmenu command as we knew it in VB6. This is fine if the menus are different than the existing main menu.Do I really have to re-create portions of the main menu for my context menus or can I somehow get the context menu to point to the main menu strip branch of my choice? (As in VB6.)
View 5 Replies
Jun 6, 2011
Schema is a string, lstSchemas is listbpb and rc is a variant
Schema = VB6.GetItemString(lstSchemas, rc)
View 1 Replies
Dec 1, 2011
In vb 6.0 when receiving data over a socket connection you used an event called dataarrival (winsock1.dataarival) to handle incoming data and process it. Is there an equivalent process in .net? i am unable to find it.
View 1 Replies
Sep 2, 2010
I am coding in VB.NET.
Currently, I am enclosing object initialization and usage in a Try/Catch block and then tear it down (dispose, close, set to nothing) in the Finally block. The problem is, a C# 'using' block is so easy to use and would clean things up in my code.
Is there a VB.NET equivalent? Or is my Finally block tear-down solution the only way?
View 4 Replies
Mar 25, 2006
I am trying to do the following...
VB
TextBox1.Left = 15
Me.Width = TextBox1.Right + 15
But the padding (of 15) is not the same on both sides. It seems like I need to be dealing with the VB6 equivalent of ScaleWidth.
View 7 Replies