Jump to content
Xtreme .Net Talk

a_jam_sandwich

Avatar/Signature
  • Posts

    371
  • Joined

  • Last visited

1 Follower

About a_jam_sandwich

  • Birthday 07/28/1980

Personal Information

  • Occupation
    Mortgage Application Programmer
  • Visual Studio .NET Version
    Professional
  • .NET Preferred Language
    VB.NET

a_jam_sandwich's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. In the end it was because I attempted to cast incorrectly the type on the deserialization of the toolbox item in the toolbox control. When adding a toolbox item on the designsurface the toolbox item gets serialized when calling DataObject and adding it to DoDragDrop, as you drag the item onto the designsurface this item it attempted to be deserialized in the toolbox, if it can the item is then availble for drag drop if not the deserialization returns nothing. Hope this helps anyone if they have the same problems Andy
  2. So much fun ... NOT Right I can drop controls onto my form using Dim objToolboxItem As New ToolboxItem(GetType(ExtendedTextbox)) Dim objToolboxService As IToolboxService = Me Dim objDataObject As DataObject = objToolboxService.SerializeToolboxItem(objToolboxItem) Call Me.DoDragDrop(objDataObject, DragDropEffects.Copy) This works fine for droping a textbox control that i've inherited from. The problem comes when I create inherited ToolboxItem which i've i'm using (hope to) to set default properties. The code i'm using below will not drag and drop on the form! <Serializable(), PermissionSetAttribute(SecurityAction.Demand, Name:="FullTrust")> _ Public Class ToolboxItemFieldBox Inherits System.Drawing.Design.ToolboxItem Public Sub New() MyBase.New() End Sub Public Sub New(ByVal ToolType As Type) MyBase.New(GetType(ExtendedTextbox)) End Sub End Class I'm at my wits end creating a designsurface to host a form editor, this has been the baine of my life this last week. Many thanks Andy
  3. I've created a control that implements IToolboxService and then added this control as a service to the DesignSurface, this now allow me to drag controls from my toolbox onto the designer form. Only problem now is how to set properties for the control such as the name and or text etc? Thanks Andy
  4. Yes I did read Divil's articles on his website but unfortunatly it did not shine to much light. Many thanks
  5. Hi, I�m currently creating a control inherited from the System.ComponentModel.Design.DesignSurface. So far I have been able to add & remove controls to and from the surface. Using the Selection service to find out selected controls on the surface but what I need to do now is have the ability to drag controls on this service from a very limited list of usercontrols contained within a Toolstrip and place them on the surface. The controls will need to have some properties set one places on the surface for example there is a field list that once you drag the field onto the surface the field properties are already set within that control based off what as field was initaly dragged. The only thing I need to do is figure out how to actually initate the drag and drop on a designer surface, searching the .NET had not thown up much in the was of help. Creation code for the control snippet. Public Class Designer Inherits DesignSurface Private mobjDragDrop As DesignerDragDrop Private mobjHost As Control = Nothing Private mobjSelectionService As ISelectionService = Nothing Private WithEvents mobjDesignerHost As IDesignerHost = Nothing Private Function New(ByVal RootType As Type) As IComponent ' Get the designer host/services Me.mobjDesignerHost = GetServiceDesignerHost() Me.mobjSelectionService = GetServiceSelectionService() ' Exit if the designer already exists If (mobjDesignerHost.RootComponent IsNot Nothing) Then Return mobjDesignerHost.RootComponent ' Root componant Call Me.BeginLoad(RootType) ' Get the designer host mobjDesignerHost = GetServiceDesignerHost() ' Root control Dim ctlControl As IComponent = Nothing ctlControl = mobjDesignerHost.RootComponent Return ctlControl End Function Any pointer would be greatly appreciated Thanks Andy
  6. a_jam_sandwich

     

    When coding HTML correctly you should fill and container with at least some data thus is used an example would be a div <div style="border: 1px solid black; height: 50px; width: 50px;></div> The above will no display correctly in Firefox as there is no content in the container so the correct way is as follows ... <div style="border: 1px solid black; height: 50px; width: 50px;> </div> Regards Andy
  7. Dim MyAdapter As New SqlClient.SqlDataAdapter("usp_rolelookup", conn) Dim MyDataset As New DataSet ' set the command type MyAdapter.SelectCommand.CommandType = CommandType.StoredProcedure ' add the parameters MyAdapter.SelectCommand.Parameters.Add("@username", currentuser) ' Use the dataadapter to fill the dataset MyAdapter.Fill(MyDataset) If MyDataset.Tables.Count > 0 Then ' do somthing with the dataset End If Nice and easy use the dataadapters fill command to fill a disconnected dataset with the stored procedures results Regards Andy
  8. Are you checking the cookie for a vote on Page Load or just before setting the vote count? If you are checking on page load then this event will not occur when the user press's the back button on the browser. Somthing like below will work regardless of pressing back ' Checking vote cookie If (Not Request.Cookies("Vote") Is Nothing) Then ' Do nothing vote already taken Else Dim HTTPCookie As New HttpCookie("Vote") HTTPCookie.Expires = Now.AddDays(365) Response.Cookies.Add(HTTPCookie) ' Do add vote code End If Regards Andy
  9. VbCrLf for VB \n for C#
  10. intresting way to update ... I have a ftp control on http://www.planet-source-code.com for ftp'ing FTP Control though you may want to try a system like a HTTP updater see my website for details on that Live updater Regards Andy
  11. I see what you mean the only way I have managed to force a change is to use the .image as "image.gif?" & Now.ToString This will work but also means that if the same image appears twice it will be loaded twice and never cached. To test i have used the following code Dim files() As String = IO.Directory.GetFiles(Server.MapPath("gifs")) IO.File.Copy(files((Rnd() * UBound(files))), Server.MapPath("image.gif"), True) Image1.ImageUrl = "image.gif?" & Now.ToString Hope that this helps Andy
  12. Dim MyString() As String MyString = Split("this is a string to split", " ") Regards Andy
  13. Eh you have lost me can you upload you code again and explain your process fully Cheers Andy
  14. If you change the HTML for your user control to something like <%@ Control Language="vb" AutoEventWireup="false" Codebehind="View_Image.ascx.vb" Inherits="Panel.View_Image" TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %> <div style="width: 160px; height: 200px; float: left; border: 1px solid #999;"> <p style="text-align: center;"> <asp:label id="lblItem" runat="server" ForeColor="#9BA8A2" Font-Size="9px" Font-Names="Verdana">Item 748</asp:label><BR> <BR> <asp:Image id="Image1" runat="server" ImageUrl="image.jpg"></asp:Image><BR> <BR> <asp:ImageButton id="ImageButton3" runat="server" ImageUrl="file:///C:\Inetpub\wwwroot\ConnexImageLibrary\Images\icoTVC.jpg"></asp:ImageButton> <asp:ImageButton id="ImageButton2" runat="server" ImageUrl="file:///C:\Inetpub\wwwroot\ConnexImageLibrary\Images\icoPrintAds.jpg"></asp:ImageButton> <asp:ImageButton id="ImageButton1" runat="server" ImageUrl="file:///C:\Inetpub\wwwroot\ConnexImageLibrary\Images\icoImages.jpg"></asp:ImageButton> </p> </div> That should do what you want Regards Andy
  15. Lol sorry bout that Robby got confused with somthing else :), I miss read it as URLEncode my bad Andy
×
×
  • Create New...