I know that this should probably be under mobile development .. but no one seems to use that thread ... so anyway .. here is what i am trying to do:
TreeView1.LabelEdit = True
With TreeView1.Nodes.Add("asd")
.BeginEdit()
End With
The above works for a windows application ... but i was wondering how i could do this on a windows mobile application as LabelEdit and BeginEdit don't exist!
I want to add nodes that behave in a similar fashion as when you add new folders in windows explorer. i.e. right click > new folder > then the new folder is added and highlighted as New Folder so that as soon as the user types they are overwriting the folder name.
I can add a new node as a child node of the node I have selected and label it "New Node" but I can't figure out how to select the new node and have it highlighted so that when the user types, they are overwriting the "New Node" text.
I have tried this but it doesn't work.
Private Sub AddProjectToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles AddProjectToolStripMenuItem.Click Me.trvProjects.SelectedNode.Nodes.Add("New Node") Me.trvProjects.SelectedNode = trvProjects.Nodes("New Node") Me.trvProjects.Focus() End Sub
I am currently editing a big mass of items, which is taking very long to do. Even loading up my Treeview from a file is faster. What I currently have is this: vb.net Private Sub IncrementTreeviewNodes(ByVal Position As Integer) While (Position < treeMeshList.Nodes.Count()) treeMeshList.Nodes(Position).Text = "Mesh #" + Position.ToString Position += 1 [Code] .....
i have an VB.NET application with few functions i need to debug (like ie. Assert in C#). Is it possible and how i do that ?
Public Shared Function createNumberArrayList(ByVal startValue As Integer, _ ByVal endValue As Integer, _ Optional ByVal isBackwards As Boolean = False) As ArrayList
[Code].....
Basically what i need is to enter few values and see if the function works and returns proper ArrayList.
I created this command from a few examples which reads the text from a StreamReader, Trims, splits on EoL, and returns a unique list. My next command is a sort. I couldnt figure out how to add a sort to this command. Its really not that important but I was curious if there�s an easy way.
Additionally if there's a better way to take a text file into an array or collection I'm all ears.
I am trying to do an inline IF statement inside a asp:Repeater control to add a class to the first item, but I can't quite seem to figure it out. Basically the code I have right now that is not working but should give an idea of what I'm "trying" to do looks like this.
<asp:Repeater ID="rptrTabRepeater" runat="server"> <ItemTemplate> <div class="tab <%= If Container.ItemIndex = 0 Then %>highlight<% End If%>"> 'Other stuff here
[code]....
I have tried using the OnItemDataBound event but the delegate interface cannot return a value. If I'm going to do anything from a code-behind function really it would just need to be an "echo" kind of function which I wasn't quite sure how to get the item index in a code behind function.
Is there any way to include some kind of auto-generated comments as part of implementing an interface? Studio automatically fills the headers for the methods, can I auto-fill some sort of code comments at that same time? (to help remember what each interface method is supposed to do without looking at external documentation.) For example, if I could get the interface's XML Intellisense markup headers to copy from the interface down to the implementation's level.
Just out of curosity, what's wrong with the following line. I'm trying to create a range of integers (3,4,5...,50) and then filtering out only those numbers which are not divisible by any integer less than themselves (bruteforce way of finding primes).
Enumerable.Range(3, 50).Where(Function(x) Not Enumerable.Range(2, x - 1).Any(Function(y) x Mod y = 0))
I would like to know if there's any way to specify an inline array (lets say of strings) to custom attribute on a property in vb.net.
I have the following example that doesn't compile in vb.net (.net 1.1):
Attributes.ManyToOne(New String() {"a", "b", "c"})> _ Public Property PaymentTerms() As PaymentTerms
[Code]....
I get compiler error when I feed the array to the custom attribute in vb.net. I have no problem in C#, just vb.net. What is the correct syntax in this silly language?
Public Class Question Private Shared _field as Integer = CrazyIntegersRepository.GetOne() ' Some other useful things go here End Class
And the method GetOne throws an exception... How can we manage that? Is a good practice to rewrite that into a static constructor? When is the GetOne method going to be executed if we leave it there in the inline _field declaration?
Check out this code sample from Scott Guthrie's blog: [URL]...Notice item is a reference to the currently executing item in C#, what is the equivalent keyword in VB.NET?
EDIT: I should add here is my actual implementation of a method accepting a template:
Public Function RenderInlineTemplate(ByVal template As Func(Of RazorSamplesWeb.Models.SamplesModel, Object)) As IHtmlString Return New HtmlString("<div style='display:inline;'>" + template(Model) + "</div>") End Function And I get this error: Compiler Error Message: BC30201: Expression expected.
I'm working on a legacy vb.net application that does most of its work using inline code ( Within that script I need to access functions from a third party .net dll. The dll(s) themself are stored in the GAC. Before I started the page looked something like the following
I'm trying to change the value in an editform before it becomes visible to the user. However the aspxgridview is always overwriting this.
This is my solution:
Protected Sub ASPxGridView_ItemList_HtmlRowCreated(ByVal sender As Object, ByVal e As DevExpress.Web.ASPxGridView.ASPxGridViewTableRowEventArgs) Handles ASPxGridView_Items.HtmlRowCreated If (e.RowType = GridViewRowType.EditForm) Then
which declares a temporary bucket variable and then assigns the associate property values to the variable. Which then sends it to the XMLElement AppendChild method. What is this design concept called? What is the conversion to VB.Net? I have tried using my own online utility that does a 90-95% conversion rate from C# <-> VB.Net. It has failed in this instance, and so need a hand-up on what i am looking to do to convert this from C# to VB.Net. I would really like to not have to do a long-declaration of a variable with assignments, if at all possible.
I would like to create a HtmlHelper function for a specific kind of dropdown that appears on many pages in my app. I'm basically just trying to add some decoration around the existing DropDownList function, but it's being encoded.[code]....
but I'd rather make use of VB's inline XML. How do I get the results of DropDownList to not be encoded?
My problem is I used to be able to do this,[URL]..and CallAFunctionThatReturnsBoolean() will be called in Page_Load when the control's DataBind function gets called implicitly and the div's visibility will be set correctly.
Now for some reason this doesn't happen anymore, and to make it work I would have to either call Page.DataBind() in my base Page class or Me.DataBind() in the Page_Load sub in that page, but I don't really want to do this, especially in the base Page class because then if I have a page with let's say a DataGrid in it that I already call the DataBind() function explicitly, then this DataGrid will get bound twice, once from Page.DateBind and once from the explicit call datagrid.DataBind().
In TSQ IF MyVal IN (1, 2, 3, 4, 14) BEGIN ... END .Is there a way to do this in VB.NET? Is it possible to check for the existence of an integer in a set of integers inline? Such as: If MyVal in (1, 2, 3, 4, 14) Then ... End If
I have managed to crunch down a several line code to this
For Each gal In galleries With New HtmlGenericControl("div") .ID = gal.Header
[code]....
I cannot find any where how to reference back to the object i am currently working with to add the control back to galleryContent' - Using plain me crashes the whole web server...Using does not offer the shorter hand of just using . - But it Using the only way to do it?
i have a treeviev and listbox.i want to display the selected contents of treeview into the listbox.my code is working for file but not for folder. means i want, if the all contents of folder ABC(i.e all files) are selected then in listbox i want to show the only path of folder not the seperate path of each file.
I've read several articles and questions/answers that conclude the best practice is to let the JIT compiler do all the optimization for inline function calls. Makes sense. What about inline variable declarations? Does the compiler optimize these as well?
[Code]...
Of course I prefer the latter because it's easier to read and debug, but I can't afford the performance degradation if it exists. I have already identified this code as a bottleneck -- No need for retorts about premature optimization.
I'm starting a new project; trying to be more strict than previous ones. I've set warnings as errors in the build I've added FxCop to PostBuild. The one last thing on my list os require people to add inline docs for all classes/non-private methods/properties.
I am on one asignment of convering C# to VB.net and stuck up with this problem.C# application has one class having inline two dimensional array initialized with size 168X168. I converted same class to Vb.net. Now whenever I create instance of my this VB.net class, It take almost 3 minute.
To figure out problem, I put break point on sub new() (first line of my constructor), and behaviour is realy strange because it takes 3 minutes to reach at first point of my constructor.Whenever I comment out my large size array initialization code, It works perfect. Now please note that same code is working fine in C#. It is not taking even few millisecond to initialize that class.