|
Exactly what happened...I started to reply and my boss came in and started talking to me, so I got sidetracked...good answer though!
|
|
|
|
|
This is exactly what I was looking for. Thanks, I appreciate the help.
|
|
|
|
|
First, I assume you've enable dragging with your TreeView . So, you want to hook the DragEnter event. When you click on a file in Windows Explorer, and start to drag, from what I can tell, it adds 8 Formats to the Data in the DragEventArgs :
Shell IDList Array
Shell Object Offsets
DragImageBits
DragContext
InShellDragLoop
FileDrop
FileNameW
FileName
FileNameW is the Windows file name and the data you're interested in. Here's an example of the DragEnter Event
If e.Data.GetDataPresent("FileNameW") Then
e.Effect = DragDropEffects.Link
End if
Then on the DragDrop
If e.Data.GetDataPresent("FileNameW") Then
End If
|
|
|
|
|
I have a routine for displaying to the user, information on the memory which is installed in their system. This routine is currently encapsulated in a class with each piece of information being returned as a property. The class's instantiated object is only used the once.
The routine that provides the class's properties with their information is executed when the class is instantiated from the calling routine requiring the memory information thus:
dim memInfo as new MemoryInformation . The class's code resides in the Public Sub New().
What I would like to know is, is this the best way to go about implementing this sort of functionality? Should I maybe use a Function and return the info in a collection of some sort or should the code in the class's New sub be moved to a separate method instead?
I'm rather new to OO programming and haven't got my head round when is the best time to use a class instead of a function. Any help would be greatly appreciated.No trees were harmed in the posting of this missive; however, a large number of quantum states were changed.
|
|
|
|
|
I vote for that being the best way. If you have a large amount of information that you need to return, then a class seems to be the way to go. As to whether to put it in the New or another function, I would normally put it into a function and have that function return a MemoryInformation class in case you want to reuse your class in a different way later, but I wouldn't begin to state that there's a right or wrong way to do that.
|
|
|
|
|
Thanks for the reply. I've been thinking along similar lines. My routines 'work' as I have them implemented at the moment. I was wondering at the time I was writing the routines whether it was the 'best' way. I've been 'brought up' as a procedural programmer and find OO programming a complete paradigm shift to what I'm used to! No trees were harmed in the posting of this missive; however, a large number of quantum states were changed.
|
|
|
|
|
Hello everybody,
I've got a problem to format the text of a button.
I'd like to change the font-weight of a substing of the button text.
To be more exactly:
The dynamicly generated text [DATE: start-time - end-time] (it's for a caledar application)
I want to date in font-weight 'bold' and the rest of the text in font-weight 'normal'
like this --> [2010-02-16: 10:00 - 11:00 ]
I googled a lot, but i just found how to do it with other controls like the RichTextBox
RichTextBox1.SelectionStart = RichTextBox1.Find("text")
RichTextBox1.SelectionColor = Color.Yellow
I can't find a solution for the button control.
Can anybody help me?
|
|
|
|
|
Hi,
a lot of Controls (Label, Button, ...) have a simple Text property for showing some text in an homogenous style, using one font, one size, one weight, one color. If that isn't sufficient for you, you'll have to choose another Control, or do the painting yourself somehow (which may be hard for Controls that may have several states, such as a Button, which can be pressed, hovered, selected, etc).
One thing you could do is use a Panel, and add two labels to it, then use the Panel.Click event
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
Ok. Thanks for your help.
|
|
|
|
|
you're welcome.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles]
I only read code that is properly formatted, adding PRE tags is the easiest way to obtain that. All Toronto weekends should be extremely wet until we get it automated in regular forums, not just QA.
|
|
|
|
|
The only way I can think of doing what you require is to override the button's OnPaint event. This way, I think you could split the date string; apply the required font to each section, paint the first string on the button, calculate where the end of that text string is, and then paint the next section after. How you would actually implement this is, I'm afraid, beyond my ability at the minute. Sorry I couldn't be of more help. No trees were harmed in the posting of this missive; however, a large number of quantum states were changed.
|
|
|
|
|
If you search through the articles here on the Code Project site, you will find quite a few that show you how to write your own custom button. I had a quick look to see if anyone had come up with an equivalent to Java's JButton support for HTML in the button caption, something like
<b>2010-02-16</b> 10:00-11:00
but I couldn't see anything. That's probably a bit harder than it first appears to get all the relevant HTML tags covered (bold, font family, font colour, italic, etc.), but it should be possible to use some of the articles to build your own custom button to get the effect you're after if you know in advance what limited functionality you want to support. You don't have to use HTML tags, that's just a starting thought; go with whatever is the easiest answer for your needs.
|
|
|
|
|
automatic login to a website I want to use webbrowser
site login screen, but you do not open the popup
site is directed to the main page.
How can I solve this problem
|
|
|
|
|
By posting in the correct forum.
Bit more specifics required e.g. Webserver? IIS/Apache; technologies? e.g. ASP.Net, PHP
If it is ASP.Net then there is functionality built into the site authentication functions to do this sort of thing.
|
|
|
|
|
Ok, i have re-read your question serveral times now, and I am thinking your are on about client side using webbrowser control?
1) You have an application using the WebBrowser Control?
2) You navigate to a website, but it requires authentication?
3) It normally throws up a popup with the login prompt, whilst the initial page is redirected to the site entry page?
Founf this via google; might go someway to getting round the problem;
redirect-winforms-web-browser-control-pop-ups-to-another-winforms-web-browser-con[^]
|
|
|
|
|
Hello all,
i made a news ticker with VB that reads xml feed from url, i need to know how many users use the ticker to make some statistics, SQL server available if required,
Thanks in advance
|
|
|
|
|
Your web server logs will give your the information, use that for the statistics.
|
|
|
|
|
its a windows application, and the xml file is shared with many other services so the request statistics wont be good
|
|
|
|
|
You could;
1) modify your app to pop in a custom header to the request, and then you could use the log files to track the custom header
2) have your app generates a unique installation id, and send that to a web service that logs the instance.
3) get your users to register
4) Have your app go through an intermediate web service, which then gets the xml and passes it back to your app.
5) dream up some of your own mechanisms for generating unique installations and tracking.
|
|
|
|
|
I wanna get burned date on CDRom....
How to get it by using VB.net?
If u can, Pls tell me....
I'll very thank ..........
|
|
|
|
|
You're assuming that this date is recorded on all disks?? It's not...
|
|
|
|
|
My lecturer wants us to change an ASP.Net Website into C#, now how do i go about doing that?
|
|
|
|
|
|
Its Better you put this Question on ASP.net Form , you will get more answers Best Regards,
SOFTDEV
If you have knowledge, let others light their candles at it
|
|
|
|
|
First, this is the VB.NET forum, not C#.
Second, ASP.NET is a technology that generates web pages, it's not a language. C# is a language.
You'll have to confirm this with your teacher, but I think yo have to convert what you see in the ASP.NET app to a Windows Forms app, using C#.
|
|
|
|