Search Results

Search found 18731 results on 750 pages for 'vb common controls replac'.

Page 5/750 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • COM INTEROP Support - which is better? C# or VB

    - by dot
    I keep hearing that c# is "better" than vb... but as far as I can see, aside from syntactical differences, both compile down to the same IL. I've found some good articles by googling that explain what the differences are between the two and so I feel comfortable in "diffusing" conversations between developers arguing over vb / c#. =) But I did read an article that said vb.net 2005 had better support for com interop stuff. But i'm wondering if this is still the case? This is of interest to me because we are in the middle of redesigning an old vb6 app that communicates with some older COM components. Does anyone have recent experience with .NET and COM interop? Thanks.

    Read the article

  • WPF User Control is causing Out of Memory Exception

    - by Chairman Meow
    Looking for a free spell checking solution, I thought I was so smart in doing this but I guess not. I have created a windows form based application and I want the form to add a user specified amount of user controls (with textboxes) on to a panel. The user can then click some button and the controls on this panel are cleared and new ones are added. The user does something and the process is repeated. Now, I wanted these textboxes to support spell checking and looked all over for a free solution. WPF textboxes support spell checking where the ones in regular win forms do not. I thought I would be able to use these WPF textboxes by adding them to an ElementHost object which is, in turn, within a panel. This panel would be a user control. So, in my application, I would be able to add instances of these user controls onto the form and make use of .NET's spell checking goodness. This actually worked but after using the application for a while, found that the application would eventually freeze on me due to out of memory errors. I have pinpointed the memory errors to these WPF controls since this problem does not happen with normal textboxes. When the window is opened and the number of controls is specified, this is pretty much how the controls are added: Dim xOffset As Integer = 0 For i As Integer = 0 To theNumber Dim myUserControl As New SpecialUserControl() myPanel.Controls.Add(myUserControl) myUserControl.Location = New Point(7, 7) myUserControl.Location = New Point(xOffset, 7) xOffset = xOffset + 207 Next Note that: myPanel is a panel on a form SpecialUserControl is the user control with WPF textbox (within an ElementHost object) When the user pressed a button, the panel is cleared: myUserControl.Controls.Clear() The user can then repeat the process. There are a lot of results on the internet when I tried to find a solution and I'm thinking that the problem I am having is due to the fact that the WPF control is not going away even after clearing the panel. Following this conclusion, I have tried different solutions regarding disposing these controls or setting them to nothing but the memory problem keeps occurring. If someone could give me some advice or ideas here, I'd really appreciate it.

    Read the article

  • [VB.Net] String Manipultation - Get String between two other Strings?

    - by Ben
    I have a large piece of text in which there is something simular to this: !#_KT_#!COMMANDHERE!#_KT_#! I want, in VB.Net, to get the 'COMMANDHERE' part of the string, how would I go about doing this? I have this so far: Dim temp As String = WebBrowser1.Document.Body.ToString Dim startIndex As Integer = temp.IndexOf("!#__KT__#!") + 1 Dim endIndex As Integer = temp.IndexOf("!#__KT__#!", startIndex) Dim extraction As String = temp.Substring(startIndex, endIndex - startIndex).Trim TextBox1.Text = extraction However this only removes the LAST string eg: #_KT_#! COMMAND. Any help is appreciated!

    Read the article

  • ASP.NET: With C# or C# + VB.NET?

    - by Sahat
    I am currently reading Beginning ASP.NET 4: in C# and VB (Wrox Programmer to Programmer) and it comes with both C# and VB.NET source code. I am definitely planning to use C# in the future for most of my projects. But VB.NET - is it really worth learning side-by-side with C#? Are there such cases when VB.NET is preferred over C#?

    Read the article

  • SELECT SQL statement problem when getting info from an accdb in VB.Net

    - by Shane Fagan
    Hi again all, im getting the error below for this SQL statement in VB.Net SQLString = "SELECT AllPropertyDetails.PropertyID, Street, Town, County, Acres, Quotas, ResidenceDetails, Status, HighestBid, AskingPrice FROM AllPropertyDetails " SQLString += "INNER JOIN Land ON AllPropertyDetails.PropertyID = Land.PropertyID " SQLString += "WHERE Deleted = False " If PriceRadioButton.Checked = True Then SQLString += "ORDER BY AskingPrice ASC" ElseIf AcresRadioButton.Checked = True Then SQLString += "ORDER BY Acres ASC" End If Any ideas why its not working? The fields in the DB and the table names seem ok but its not working :/ System.InvalidOperationException was unhandled Message="An error occurred creating the form. See Exception.InnerException for details. The error is: No value given for one or more required parameters." Source="AuctioneerProject" StackTrace: at AuctioneerProject.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 at AuctioneerProject.My.MyProject.MyForms.get_LandReport() at AuctioneerProject.ReportsMenu.LandButton_Click(Object sender, EventArgs e) in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\ReportsMenu.vb:line 4 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at AuctioneerProject.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Data.OleDb.OleDbException ErrorCode=-2147217904 Message="No value given for one or more required parameters." Source="Microsoft Office Access Database Engine" StackTrace: at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at AuctioneerProject.LandReport.load_Land() in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.vb:line 37 at AuctioneerProject.LandReport.PriceRadioButton_CheckedChanged(Object sender, EventArgs e) in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.vb:line 79 at System.Windows.Forms.RadioButton.OnCheckedChanged(EventArgs e) at System.Windows.Forms.RadioButton.set_Checked(Boolean value) at AuctioneerProject.LandReport.InitializeComponent() in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.designer.vb:line 40 at AuctioneerProject.LandReport..ctor() in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.vb:line 5 InnerException:

    Read the article

  • ASP.NET with C# or VB.NET + C#?

    - by Sahat
    I am currently reading Beginning ASP.NET 4: in C# and VB (Wrox Programmer to Programmer) and it comes with both C# and VB.NET source code. I am definitely planning to use C# in the future for most of my projects. But VB.NET - is it worth learning side-by-side with C#? Will there be a case when VB.NET is preferred over C#?

    Read the article

  • How to open child forms positioned within MDI parent in VB.NET?

    - by user961627
    How do we arrange child forms in a parent MDI window? I'm able to call and display a child form from a menu on the parent, but the child pops up outside the parent - I want it to actually be inside the parent. I've checked in C# and VB.Net solutions but they all say pretty much the same, i.e. try to access LayoutMDI, such as here: http://msdn.microsoft.com/en-us/library/x9fhk181.aspx The problem is, where do I access this? When I'm in the code of my MDI parent, Me.LayoutMdi is not recognized. In which part of the application do I put the Me.LayoutMDI code? Edit The Me.LayoutMDI code worked in the parent after all. I'd been trying for a while but don't know where I was going wrong. However, the child continues to pop up out of the parent. Here's an image of how that happens. The broader form in the back is the parent, and the one with the gridview and two buttons is the new child that popped up. I want it to pop up "Docked" within the parent.

    Read the article

  • Is there any practical use for the empty type in Common Lisp?

    - by Pedro Rodrigues
    The Common Lisp spec states that nil is the name of the empty type, but I've never found any situation in Common Lisp where I felt like the empty type was useful/necessary. Is it there just for completeness sake (and removing it wouldn't cause any harm to anyone)? Or is there really some practical use for the empty type in Common Lisp? If yes, then I would prefer an answer with code example. For example, in Haskell the empty type can be used when binding foreign data structures, to make sure that no one tries to create values of that type without using the data structure's foreign interface (although in this case, the type is not really empty).

    Read the article

  • What are some good/reputable/widely-used libraries written in VB.NET?

    - by Dan Tao
    Generally speaking, when VB.NET and C# are compared, there is a lot of strong support for C#, accompanied by some bashing of VB.NET until a respected developer comes along and acts as The Voice Of Reason, pointing out that while VB prior to VB.NET had its fair share of issues, VB.NET is really a very strong, fully OOP language that is, feature-wise, right about on par with C# (with the exception of certain things like a full-bodied lamba syntax [pre-VB10] or the yield keyword, as many C# faithfuls are quick to point out). I myself, having written plenty of code in both VB.NET and C#, fall squarely in the "I prefer C#, but don't consider VB.NET any less of a language" camp. However, one thing I have noticed is that when it comes to respected and/or widely-used libraries for .NET, everyting is written in C#. Or at least that's been my impression. This strikes me as a little strange because, aside from the abovementioned sprinkling of nice features (in particular the yield keyword), I tend to view the VB.NET/C# divide as primarily a matter of personal taste. Obviously, plenty of developers prefer C#. But I personally know some developers (good ones) who prefer VB.NET, which would lead me to suspect that surely some libraries (good ones) would be written in VB.NET. They must be out there, and I just haven't found them. What are some good libraries that've been written in VB.NET? The best would be open source, as that would allow interested developers to take a look at some good VB.NET code and see how effective the language can be when used properly. But I'd be interested to know about any libraries at all, particularly reputable ones.

    Read the article

  • Need to replace 3rd party WinForm controls, what's the closet WPF equivalent?

    - by Refracted Paladin
    I am tired of Windows Forms...I just am. I am not trying to start a debate on it I am just bored with it. Unfortunately we have become dependent on 4 controls in DevExpress XtraEditors. I have had nothing but difficulties with them and I want to move on. What I need now is what the closet replacement would be for the 4 controls I am using. Here they are: LookUpEdit - this is a dropdown that filters the dropdown list as you type. MemoExEdit - this is a textbox that 'pops up' a bigger area when it has focus CheckedComboBoxEdit - this is a dropdown of checkboxes. CheckedListBoxControl - this is a nicely columned list box of checkboxes This is a LOB app that has tons of data entry. In reality, the first two are nice but not essential. The second two are essential in that I would either need to replicate the functionality or change the way the users are interacting with that particular data. I am looking for help in replicating these in a WPF environment with existing controls(codeplex etc) or in straight XAML. Any code or direction would be greatly appreciated but mostly I am hoping to avoid any commercial 3rd party WPF and would instead like to focus on building them myself(but I need direction) or using Codeplex

    Read the article

  • How to setup a webserver in common lisp?

    - by Serpico
    Several months ago, I was inspired by the magnificent book ANSI Common Lisp written by Paul Graham, and the statement that Lisp could be used as a secret weapon in your web development, published by the same author on his blog. Wow, that is amazing. That is something that I have been looking for long time. The author really developed a successful web applcation and sold it to Yahoo. With those encouraging images, I determined to spend some time (1 year or 2 year, who knows) on learning Common Lisp. Maybe someday I will development my web application and turn into a great Lisp expert. In fact, this is the second time for me to get to study Lisp. The first time was a couple of years ago when I was fascinated by the famous book SICP but found later Scheme was so unbelievably immature for real life application. After reading some chapters of ANSI Common Lisp, I was pretty sure that is a great book full of detailed exploration of Common Lisp. Then I began to set up a web server in Common Lisp. After all, this should be the best way if you want to learn something. Demonstrations are always better than definations. As suggested by the book Practical Common Lisp (by the way, this is also a great book), I chose to install AllegroServe on some Common Lisp implementation. Then, from somewhere else, I learned that Hunchentoot seems to be better than AllegroServe. (I don't remember where and whom this word is from. So don't argue with me.) Ironically, you know what, I never could installed the two packages on any Common Lisp implementation. More annoyingly, I even don't know why. The machine always spit up a lot of jargon and lead me into a chaos. I've tried searching the internet and have not found anything. Could anybody who has successfully installed these packages in Linux tell me how you did it? Have you run into any trouble? How did you figured out what is wrong and fixed it? The more detailed, the more helpful.

    Read the article

  • Parental Controls in Ubuntu - per user

    - by Hamish Downer
    I would like to set up parental controls on Ubuntu for a friend of mine. I want it so that the child user has the controls set, but the parent user is not restricted. To be clear, they are sharing one computer, so a router based solution won't help. And I would like a set of step by step instructions to do this. Just one way of doing it. I'm an experienced Ubuntu user, happy at the command line. I've spent quite some time googling for this along the way. I hope that the GChildCare project will eventually make this easy, but it is not ready yet. In the meantime, the WebContentControl GUI provides a way of managing parental controls, but apply them to every user on the computer (easy WebContentContol install instructions and detailed instructions, discussion and related links on ubuntuforums). The ubuntuforums post has a FAQ that states that user-specific configuration is not possible with WebContentControl, and then provides 3 links he used to help him do it. But they are far from step by step instructions. There is this thread which is notes along the way and linking to this article about squid and dansguardian. And then to these two dansguardian articles which are somewhat in depth ... So does anyone know of an existing guide to how to set up parental controls on ubuntu with some users not affected? If no one has come up with an answer after a little bit, I'll set up a community wiki answer so we can come up with a guide.

    Read the article

  • Dynamic controls not creating with RSS reader function

    - by TuxMeister
    Hello, I am working on a test project for an RSS reader. I am using Chilkat's module for .NET 3.5. What I am trying to do is this: For each item in the RSS feed, I want to dynamically create some controls (labels) that contain stuff like the title, the link and the publication date. The problem is that only the first control comes up "rssTitle", but not the rest and it's definitely not creating the rest, nor cycling through the RSS items. Any ideas where I'm wrong in my code? Imports Chilkat Public Class Form1 Dim rss As New Chilkat.Rss Dim success As Boolean Dim rssTitle As New Label Dim rssLink As New Label Dim rssPubDate As New Label Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click success = rss.DownloadRss("http://www.engadget.com/rss.xml") If success <> True Then MessageBox.Show(rss.LastErrorText) Exit Sub End If Dim rssChannel As Chilkat.Rss rssChannel = rss.GetChannel(0) If rssChannel Is Nothing Then MessageBox.Show("No channel found.") Exit Sub End If Dim numItems As Long numItems = rssChannel.NumItems Dim i As Long For i = 0 To numItems - 1 Dim rssItem As Chilkat.Rss rssItem = rssChannel.GetItem(i) Me.Controls.Add(rssTitle) With rssTitle .Name = "rssTitle" & Me.Controls.Count.ToString + 1 .Text = "Title: " & rssItem.GetString("title") .Left = 12 .Top = 12 End With Me.Controls.Add(rssLink) With rssLink .Name = "rssLink" & Me.Controls.Count.ToString + 1 .Text = "Link: " & rssItem.GetString("link") .Left = 12 .Top = 12 End With Me.Controls.Add(rssPubDate) With rssPubDate .Name = "rssPubDate" & Me.Controls.Count.ToString + 1 .Text = "Pub date: " & rssItem.GetString("pubDate") .Left = 12 .Top = 12 End With Next End Sub End Class I'm grateful for any help. Thanks!

    Read the article

  • How do you set DEBUG or RELEASE builds in Visual Studio 2008 (VB.net)

    - by GregH
    This has been driving me crazy...I have VS 2008 and am developing vb.net applications. How do I specify if I am building a debug or release version? The description I found of how to do this on the Microsoft site (http://msdn.microsoft.com/en-us/library/wx0123s5.aspx) don't seem to be accurate. This should be pretty straight forward shouldn't it? It seems that a friend of mine that does C# development says it is easy in his environment. Are the VS environments different between C# and VB?

    Read the article

  • Retrieving Page Controls Programmatically

    Home » ASP.net » Retrieving Page Controls Programmatically Retrieving Page Controls Programmatically ? There might be situations where you want to retrieve controls that are present in a web page and process them. In that case this article can be very use. Basically a web page is a container for all controls and for retrieving all controls we need to traverse the control tree. So for this this program can be used to disable all form controls at runtime

    Read the article

  • Strong Naming an assembly using command line compile

    - by David
    I am trying to use NAnt in order to compile and sign an assembly using the vbc compiler. I have a project set up and am able to successfully sign the assembly compiling with VS2010. When I try to sign it using the command line I get this error: vbc : error BC30140: Error creating assembly manifest: Error signing assembly -- The parameter is incorrect. I even created a trivially simple app (just an assemblyinfo.vb file) that will not compile and sign using vbc.exe What am I doing wrong? here is my assemblyinfo.vb: Option Strict Off Option Explicit On Imports System Imports System.Reflection <Assembly: AssemblyVersionAttribute("2010.05.18.0918"), _ Assembly: AssemblyCopyrightAttribute("Copyright © Patient First 2007"), _ Assembly: AssemblyCompanyAttribute("Patient First, Inc."), _ Assembly: AssemblyProductAttribute("Patient First Framework"), _ Assembly: AssemblyDelaySign(false), _ Assembly: AssemblyKeyFile("test.pfx"), _ Assembly: AssemblyTitleAttribute("PatientFirst.Framework")> test.pfx is located in the same folder as assemblyinfo.vb Here is how I am trying to compile it: vbc /target:library /verbose assemblyinfo.vb I also tried using vbc /target:library /verbose assemblyinfo.vb /keyfile:test.pfx and tried using /keyfile parameter without the AssemblyDelaySign and AssemblyKeyFile attributes If I remove the AssemblyDelaySign and AssemblyKeyFile attributes and leave off the /keyfile command line parameter it compiles fine. What is the correct way to do this with vbc? --EDIT: I have found that MSBuild also does not like having the AssemblyKeyFile attribute as I have defined it in the AssemblyInfo.vb, it gives the same failure message. So the only way I can currently get this to build correctly is to set properties on the project to tell it which key file to use and to sign the assembly.

    Read the article

  • Convert C# (with typed events) to VB.NET

    - by Steven
    I have an ASPX page (with VB Codebehind). I would like to extend the GridView class to show the header / footer when no rows are returned. I found a C# example online (link) (source). However, I cannot convert it to VB because it uses typed events (which are not legal in VB). I have tried several free C# to VB.NET converters online, but none have worked. Please convert the example to VB.NET or provide an alternate method of extending the GridView class. Notes / Difficulties: If you get an error with DataView objects, specify the type as System.Data.DataView and the type comparison could be the following: If data.[GetType]() Is GetType(System.Data.DataView) Then Since the event MustAddARow cannot have a type in VB (and RaiseEvent event doesn't have a return value), how can I compare it to Nothing in the function OnMustAddARow()? EDIT: The following is a sample with (hopefully) relevant code to help answer the question. namespace AlwaysShowHeaderFooter { public delegate IEnumerable MustAddARowHandler(IEnumerable data); public class GridViewAlwaysShow : GridView { ////////////////////////////////////// // Various member functions omitted // ////////////////////////////////////// protected IEnumerable OnMustAddARow(IEnumerable data) { if (MustAddARow == null) { throw new NullReferenceException("The datasource has no rows. You must handle the \"MustAddARow\" Event."); } return MustAddARow(data); } public event MustAddARowHandler MustAddARow; } }

    Read the article

  • How can I use Databound variables in conditional statements within Custom Databound controls?

    - by William Calleja
    I'm developing my custom DataBound Controls that make use of an '<ItemTemplate>' tag and '<%# %>' server tags to generate some data however I need to make a conditional statement within one of my Databound controls as shown below. <custom:DataboundControl runat="server"> <ItemTemplate> <% if(((Dictionary<string, string>)Container.DataItem)["MyVariable"]=="" { %> <!-- Conditional Code Happens Here --> <% } %> </ItemTemplate> </custom:DataboundControl> Right now my code isn't working because the compiler cannot recognize my Container.DataItem variable within a <% %> tag and a <%# %> tag doesn't support conditional statements. What can I use?

    Read the article

  • .NET: Interface Problem VB.net Getter Only Interface

    - by snmcdonald
    Why does an interface override a class definition and violate class encapsulation? I have included two samples below, one in C# and one in VB.net? VB.net Module Module1 Sub Main() Dim testInterface As ITest = New TestMe Console.WriteLine(testInterface.Testable) ''// Prints False testInterface.Testable = True ''// Access to Private!!! Console.WriteLine(testInterface.Testable) ''// Prints True Dim testClass As TestMe = New TestMe Console.WriteLine(testClass.Testable) ''// Prints False ''//testClass.Testable = True ''// Compile Error Console.WriteLine(testClass.Testable) ''// Prints False End Sub End Module Public Class TestMe : Implements ITest Private m_testable As Boolean = False Public Property Testable As Boolean Implements ITest.Testable Get Return m_testable End Get Private Set(ByVal value As Boolean) m_testable = value End Set End Property End Class Interface ITest Property Testable As Boolean End Interface C# using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace InterfaceCSTest { class Program { static void Main(string[] args) { ITest testInterface = new TestMe(); Console.WriteLine(testInterface.Testable); testInterface.Testable = true; Console.WriteLine(testInterface.Testable); TestMe testClass = new TestMe(); Console.WriteLine(testClass.Testable); //testClass.Testable = true; Console.WriteLine(testClass.Testable); } } class TestMe : ITest { private bool m_testable = false; public bool Testable { get { return m_testable; } private set { m_testable = value; } } } interface ITest { bool Testable { get; set; } } } More Specifically How do I implement a interface in VB.net that will allow for a private setter. For example in C# I can declare: class TestMe : ITest { private bool m_testable = false; public bool Testable { get { return m_testable; } private set //No Compile Error here! { m_testable = value; } } } interface ITest { bool Testable { get; } } However, if I declare an interface property as readonly in VB.net I cannot create a setter. If I create a VB.net interface as just a plain old property then interface declarations will violate my encapsulation. Public Class TestMe : Implements ITest Private m_testable As Boolean = False Public ReadOnly Property Testable As Boolean Implements ITest.Testable Get Return m_testable End Get Private Set(ByVal value As Boolean) ''//Compile Error m_testable = value End Set End Property End Class Interface ITest ReadOnly Property Testable As Boolean End Interface So my question is, how do I define a getter only Interface in VB.net with proper encapsulation? I figured the first example would have been the best method. However, it appears as if interface definitions overrule class definitions. So I tried to create a getter only (Readonly) property like in C# but it does not work for VB.net. Maybe this is just a limitation of the language?

    Read the article

  • Allow IExtenderProvider control to attach to controls on a UserControl

    - by Justin
    VB.NET 2.0 Framework I developed a control that implements IExtenderProvider in order to attach to controls and display a form for translating of the text of that control. This works great on regular controls on the form but the IExtenderProvider is not attaching to controls on UserControls, which makes sense. Is it possible to modify the UserControls or my IExtenderProvider control to enable it to attach to controls on a UserControl? Thanks!

    Read the article

  • VB.Net: exception on ExecuteReader() using OleDbCommand and Access

    - by Shane Fagan
    Hi again all, im getting the error below for this SQL statement in VB.Net 'Fill in the datagrid with the info needed from the accdb file 'to make it simple to access the db connstring = "Provider=Microsoft.ACE.OLEDB.12.0;Data " connstring += "Source=" & Application.StartupPath & "\AuctioneerSystem.accdb" 'make the new connection conn = New System.Data.OleDb.OleDbConnection(connstring) 'the sql command SQLString = "SELECT AllPropertyDetails.PropertyID, Street, Town, County, Acres, Quotas, ResidenceDetails, Status, HighestBid, AskingPrice FROM AllPropertyDetails " SQLString += "INNER JOIN Land ON AllPropertyDetails.PropertyID = Land.PropertyID " SQLString += "WHERE Deleted = False " If PriceRadioButton.Checked = True Then SQLString += "ORDER BY AskingPrice ASC" ElseIf AcresRadioButton.Checked = True Then SQLString += "ORDER BY Acres ASC" End If 'try to open the connection conn.Open() 'if the connection is open If ConnectionState.Open.ToString = "Open" Then 'use the sqlstring and conn to create the command cmd = New System.Data.OleDb.OleDbCommand(SQLString, conn) 'read the db and put it into dr dr = cmd.ExecuteReader If dr.HasRows Then 'if there is rows in the db then make sure the list box is clear 'clear the rows and columns if there is rows in the data grid LandDataGridView.Rows.Clear() LandDataGridView.Columns.Clear() 'add the columns LandDataGridView.Columns.Add("PropertyNumber", "Property Number") LandDataGridView.Columns.Add("Address", "Address") LandDataGridView.Columns.Add("Acres", "No. of Acres") LandDataGridView.Columns.Add("Quotas", "Quotas") LandDataGridView.Columns.Add("Details", "Residence Details") LandDataGridView.Columns.Add("Status", "Status") LandDataGridView.Columns.Add("HighestBid", "Highest Bid") LandDataGridView.Columns.Add("Price", "Asking Price") While dr.Read 'output the fields into the data grid LandDataGridView.Rows.Add( _ dr.Item("PropertyID").ToString _ , dr.Item("Street").ToString & " " & dr.Item("Town").ToString & ", " & dr.Item("County").ToString _ , dr.Item("Acres").ToString _ , dr.Item("Quota").ToString _ , dr.Item("ResidenceDetails").ToString _ , dr.Item("Status").ToString _ , dr.Item("HighestBid").ToString _ , dr.Item("AskingPrice").ToString) End While End If 'close the data reader dr.Close() End If 'close the connection conn.Close() Any ideas why its not working? The fields in the DB and the table names seem ok but its not working :/ The tables are AllPropertyDetails ProperyID:Number Street: text Town: text County: text Status: text HighestBid: Currency AskingPrice: Currency Land PropertyID: Number Acres: Number Quotas: Text ResidenceDetails: text System.InvalidOperationException was unhandled Message="An error occurred creating the form. See Exception.InnerException for details. The error is: No value given for one or more required parameters." Source="AuctioneerProject" StackTrace: at AuctioneerProject.My.MyProject.MyForms.Create__Instance__[T](T Instance) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 190 at AuctioneerProject.My.MyProject.MyForms.get_LandReport() at AuctioneerProject.ReportsMenu.LandButton_Click(Object sender, EventArgs e) in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\ReportsMenu.vb:line 4 at System.Windows.Forms.Control.OnClick(EventArgs e) at System.Windows.Forms.Button.OnClick(EventArgs e) at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at System.Windows.Forms.ButtonBase.WndProc(Message& m) at System.Windows.Forms.Button.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg) at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData) at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context) at System.Windows.Forms.Application.Run(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine) at AuctioneerProject.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:line 81 at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args) at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() at System.Threading.ThreadHelper.ThreadStart_Context(Object state) at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) at System.Threading.ThreadHelper.ThreadStart() InnerException: System.Data.OleDb.OleDbException ErrorCode=-2147217904 Message="No value given for one or more required parameters." Source="Microsoft Office Access Database Engine" StackTrace: at System.Data.OleDb.OleDbCommand.ExecuteCommandTextErrorHandling(OleDbHResult hr) at System.Data.OleDb.OleDbCommand.ExecuteCommandTextForSingleResult(tagDBPARAMS dbParams, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommandText(Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteCommand(CommandBehavior behavior, Object& executeResult) at System.Data.OleDb.OleDbCommand.ExecuteReaderInternal(CommandBehavior behavior, String method) at System.Data.OleDb.OleDbCommand.ExecuteReader(CommandBehavior behavior) at System.Data.OleDb.OleDbCommand.ExecuteReader() at AuctioneerProject.LandReport.load_Land() in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.vb:line 37 at AuctioneerProject.LandReport.PriceRadioButton_CheckedChanged(Object sender, EventArgs e) in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.vb:line 79 at System.Windows.Forms.RadioButton.OnCheckedChanged(EventArgs e) at System.Windows.Forms.RadioButton.set_Checked(Boolean value) at AuctioneerProject.LandReport.InitializeComponent() in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.designer.vb:line 40 at AuctioneerProject.LandReport..ctor() in C:\Users\admin\Desktop\Auctioneers\AuctioneerProject\AuctioneerProject\LandReport.vb:line 5 InnerException:

    Read the article

  • Does any one knows how to use the WinHttpRequest to login facebook or gmail in VB.NET(2010 Version)?

    - by ???
    Now, I can download the webpage source code to the RichTextBox. But now I want to use the WinHttpRequest to login facebook or gmail,etc. I tried to do, but it didn't work!Any one can help me? Thnak you! This is my code: Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click RichTextBox1.Text = winhttp("http://www.facebook.com") End Sub Function winhttp(ByVal URL As String) As String Dim pass, email As String pass = "my password" email = "myemail" Dim winHTTPReq : winHTTPReq = CreateObject("WinHttp.WinHttpRequest.5.1") Dim objhttp As Object = CreateObject("WinHttp.WinHttpRequest.5.1") Dim Data As String objhttp.Open("POST", URL, False) ''method objhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded") objhttp.setRequestHeader("Referer", "your refresh url") objhttp.send("email=" & email & "&pass=" & pass & "&perm_login=on") objhttp.WaitForResponse() Data = objhttp.responseText Data = Replace(Data, " ", "") Data = Replace(Data, vbTab, "") Data = Replace(Data, vbCrLf, "") Data = Replace(Data, " ", "") Return Data End Function End Class

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >