Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
T

Tom Wright

@Tom Wright
About
Posts
452
Topics
170
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Downloading PDF's from website
    T Tom Wright

    If I dumped the html in to a bowser object on my app where the end user logged on, would those credentials carry over to my app? Hope this makes sense.

    Tom Wright tawright915@gmail.com

    C# com question

  • Downloading PDF's from website
    T Tom Wright

    Your right....opened it with a hex editor and found HTML. Renamed the extension to .html and it's the logon page. Okay so even though I have logged on outside of my app and checked the box to remember me, it does not use that cookie. So how do I pass the username and password in my app to grab the file? Thanks

    Tom Wright tawright915@gmail.com

    C# com question

  • Downloading PDF's from website
    T Tom Wright

    I wrote a program that will find all links to PDF's on a site and download them. However when I look at the downloaded PDF's they are all the same size and corrupted. If I download them via IE they are differnt sizes and they open just fine. My download code is: Webclient wc = new WebClient(); wc.DownLoadFile("http://www.somesite.com/somepage/somefile.pdf", "c:\site\somefile.pdf"); I get no errors. I'm not sure if this makes a difference but if I look at the source of the site they have the href to the pdf as href="/somepage/somefile.pdf" I string the hostname to the front of the URL. I know I can do an httpwebrequest but how will I know how big to make my buffer. Suggestions? Thanks

    Tom Wright tawright915@gmail.com

    C# com question

  • referencing a control from a string
    T Tom Wright

    I see. I did not know that I had to iterate through all of the controls. Currently the Radio buttons are in group fields. I have 6 sets of Run/Stop radiobuttons on my form in 6 group fields. I ran into a problem where they were not in group fields and then only one radiobutton was allowed to be selected from the rest. Thanks for the help. Tom

    Tom Wright tawright915@gmail.com

    C# com help question

  • referencing a control from a string
    T Tom Wright

    pb.Image = temp; <----- Here....when I try and set the image.

    Tom Wright tawright915@gmail.com

    C# com help question

  • referencing a control from a string
    T Tom Wright

    The exact error was: Object reference not set to an instance of an object. T

    Tom Wright tawright915@gmail.com

    C# com help question

  • referencing a control from a string
    T Tom Wright

    I did it that way because when I reference the PictureBox.image property I received and error that the object had not been instantiated. Either way it's still null...almost like it cannot find it. Oh...and I did have it like this: OnLoadPictureImage(rb.Tag.ToString(), rb.Checked); Just doing some debugging when I thought I'd post this to the forum and I forgot to set it back like I had it. Thanks for the help. Tom

    Tom Wright tawright915@gmail.com

    C# com help question

  • referencing a control from a string
    T Tom Wright

    I have a number of PictureBox controls that show a Street Stop Light. Each Picturebox control is controled by two radio buttons for a total of 8 picturebox control and 16 radio buttons. One for Run (turns the Stop Light Green) One for Stop (turns the light red). I am storing the name of the PictureBox control in the tag of it respective radio buttons. Can I take this string and use it to reference the Picturebox control and change the image? Here is me code:

        private void OnCheckedChange(object sender, EventArgs e)
        {
            RadioButton rb = (RadioButton)sender;
            if (rb.Checked && rb.Text.Contains("Run"))
            {
                OnLoadPictureImage(rb.Tag.ToString(), radioButton1.Checked);
            }
            else
            {
                OnLoadPictureImage(rb.Tag.ToString(), radioButton1.Checked);
            }
        }
    
        private void OnLoadPictureImage(String picBox, Boolean ObjectStatus)
        {
            try
            {
                PictureBox pb = new PictureBox();
                pb = (PictureBox)this.Controls\[picBox\];
                if (ObjectStatus)
                {
                    Stream s = File.Open("../images/traffic-light-green.jpg", FileMode.Open);
                    Image temp = Image.FromStream(s);
                    s.Close();
                    pb.Image = temp;
                }
                else
                {
                    Stream s = File.Open("../images/traffic-light-red.jpg", FileMode.Open);
                    Image temp = Image.FromStream(s);
                    s.Close();
                    pb.Image = temp;
                }
            }
            catch (Exception err)
            {
                MessageBox.Show("Error finding image: " + err.Message);
            }
        }
    

    Is this not possible? Thanks Tom

    Tom Wright tawright915@gmail.com

    C# com help question

  • I need some direction on a web page
    T Tom Wright

    <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="PolicySearch.master.cs" Inherits="ScholarPoliciesSearch.PolicySearch" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head runat="server"> <title>Untitled Page</title> <asp:ContentPlaceHolder ID="head" runat="server"> </asp:ContentPlaceHolder> <link href="Styles/Stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <form id="form1" runat="server" action="javascript:fxSearch();"> <div id="HeaderContent"> </div> <div id="mainContent"> <asp:ContentPlaceHolder ID="MainContent" runat="server"> </asp:ContentPlaceHolder> </div> <div id="LeftNavBar"> <asp:ContentPlaceHolder ID="leftNavBar" runat="server"> </asp:ContentPlaceHolder> </div> <div id="FooterContent"> </div> </form> </body> </html>

    Tom Wright tawright915@gmail.com

    ASP.NET com question

  • I need some direction on a web page
    T Tom Wright

    We have a content server where the user checks in a document. I grab the document from the content server and in the navbar content place holder use an include to mash in their links from the document.

    Tom Wright tawright915@gmail.com

    ASP.NET com question

  • I need some direction on a web page
    T Tom Wright

    I want to create a web page where the left navigation bar and the content page can be changed by the end user. I started by creating a master page. While I can get the main content page to show, I cannot get the left hand nav bar to show it's content. In the mater page I created a conten place holder for the main content and one for the left hand nav bar and in my LeftNav.aspx I put in the code to create a list. However when I run the page nothing shows up in the left content place holder. Has anyone done something like this and if so can you comment on this? Thanks

    Tom Wright tawright915@gmail.com

    ASP.NET com question

  • I hate reportviewer......isn't there something better!?!?
    T Tom Wright

    Dave I was looking into that but I don't know....do I need to install something special on the end users PC in order to get the report to work? Tom

    Tom Wright tawright915@gmail.com

    Visual Basic com question

  • how do I determine which button was clicked on a prevoius form to access the form I am currently working on?
    T Tom Wright

    Just set the click event for both buttons then do a select case on the sender object of the event like below: private sub form_Click(ByVal send as System.Object, ByVal e as System.EventArgs)Handles form1Btn.Click, form2Btn.Click Select Case sender.name Case "form1" 'do something here Case "form2" 'do something else End Select End Sub That should do it. I did this for an airplane seating chart. Worked great. Each seat was really a button and once it was taken I put a big red X on it to show that is was not avaliable. Tom

    Tom Wright tawright915@gmail.com

    Visual Basic question tutorial

  • I hate reportviewer......isn't there something better!?!?
    T Tom Wright

    I'm writing an app that uses report viewer to create a detail report.....sorta like a invoice, where it lists the company name and all that they bought and an image of the item they bought. So I created my report and the sub-report for the details section. However when I go to run it I get the company name but the details section grabs all parts for all companies then the break on the next company....then repeats. Isn't there something else that is better than this? And I cannot believe that there is no one around me that has never used this...how are all these apps getting written that are using some report? thanks for letting me vent. Any suggestion would be appreciated. And by the way I am passing the key as a parameter from the main report to the sub. Tom

    Tom Wright tawright915@gmail.com

    Visual Basic com question

  • VB.NET / ADO question
    T Tom Wright

    I needed to make a change to the size of a field in an access database so that it would store a path to an image. The field was a text field with a size of 50...I changed it to size of 255 which is the max. So now I cannot figure out what I need to update in my program so that it will pick up the new field size change. I keep getting an error that says I am violating the maxlength limit of the column. Any suggestions? Thanks

    Tom Wright tawright915@gmail.com

    Visual Basic question csharp database com

  • ADO.NET update/select question
    T Tom Wright

    I'm modifying a program (oQuery) that I found on this site so that it will allow updates too. My problem is how do I do an update using some generic query execution. My problem comes up when I try and get the number of rows returned. So how can I tell that the user just did an update and then find out how many rows were affect by that update? mssqlComm.CommandType = CommandType.Text mssqlComm.CommandText = sqlQuery 'this is the query from the user mssqlComm.Connection = mssqlConn mssqlcomm.ExecuteNonQuery() mssqladpt = New SqlDataAdapter(mssqlcomm) mssqlds = New DataSet mssqladpt.fill(mssqlds) Thanks Tom

    Tom Wright tawright915@gmail.com

    Database question csharp database com help

  • VB.NET Question
    T Tom Wright

    Okay, I have my first VB.NET interview coming up in a couple of weeks and I want to prepare (currently I am doing COBOL and PLSQL)I used to program in C# and have been writing some VB.NEt apps on the side. Can you guys give me some question that you think I might be asked so that I can bone up on my terms and definitions? Thanks Tom

    Tom Wright tawright915@gmail.com

    Visual Basic csharp question oracle com

  • Concat in SQL query
    T Tom Wright

    Is there a way to string together a value that is returned by a query wihtout writing function or PLSQL? Table Def: ky_remarks no_remarks_seq tx_remarks_generic For instance select tx_remarks_generic from remarks where ky_remarks = 232323324 and no_remarks_seq > 0 no_remarks_seq = numeric and allows for multipule lines of remarks. How can I string all the remarks for that key together in my SQL? Thanks Tom

    Tom Wright tawright915@gmail.com

    Database database question oracle com

  • module - what is this
    T Tom Wright

    So do I access the subs and functions of a module as if they were in my code? I do not need to declare it or instantiate it? Tom

    Tom Wright tawright915@gmail.com

    Visual Basic com question

  • module - what is this
    T Tom Wright

    I've come across some sample code and at the top of the code, after the imports and before the class declaration, it says module BLAH. What is a module. I've never seen this before. Thanks Tom

    Tom Wright tawright915@gmail.com

    Visual Basic com question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups