|
This Works like a dream for me.
Dim pt as point
dim hdMousDown as Boolean
Private Sub SetPoint()
If hdMousedown = True Then hdMousedown = False Else hdMousedown = True
pt = Me.PointToClient(Control.MousePosition)
End Sub
Private Sub Form1_MouseDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseDown
SetPoint()
End Sub
Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseUp
SetPoint()
End Sub
Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Form1.MouseMove
If hdMousedown = True Then
Me.Location = New Point(Control.MousePosition.X - pt.X, Control.MousePosition.Y - pt.Y)
End If
End Sub
|
|
|
|
|
A couple of days ago I posted the questionon how to do this:
Datagridname.Columns.Add(New DataColumn("Name", Gettype(String)))
for a gridview and I got this answer: "It said it suppose to be a DataControlField. DataControlField is the abstract class of TemplateField, BoundField, hyperlinkfield and etc.. "
BoundField bf = new BoundField();
bf.DataField = "DateOfBirth";
GridView1.Columns.Add (bf);
Thank you so very much - you helped tremendously. Now I'm wondering if you or anyone else can help me to create an Itemtemplate field in the same manner - I need it to be a dropdownlist but don't see where the dropdown is a choice for the Itemtemplate. Any help on this would be greatly appreciated. And - the help I received is VERY appreciated! Thanks!
Coleen
"Even the smallest foot leaves an impression"
|
|
|
|
|
You can use TemplateField instead of BoundField.
|
|
|
|
|
Thanks Michael - I tried that; the problem is that there is not a member of the TemplateField that allows me to "tell" that field that it needs to be a dropdownlist in the VB codebehind. When I do this:
Dim tfModeTy as new TemplateField
tfModeTy. there is no selection of dropdown list - so I tried tfModeTy.EditItemTemplate and the only available method is InstantiateIn - which I don't understand how to use. Is there any documentation on how to make the EditItemTemplate into a dropdownlist? I've gotten a very good link on this - but unfortunately I don't quite understand how to implement it. It really makes no sense that in the ASP.Net code I could easily write:
<asp:TemplateField HeaderText="Cities">
<ItemTemplate>
<asp:DropDownList ID="ddlCities"AutoPostBack="true" runat="server"
OnSelectedIndexChanged="ddlCities_SelectedIndexChanged"></asp:DropDownList>
</ItemTemplate>
</asp:TemplateField>
And yet in the VB Code Behind there is no option on the ItemTemplate of DropDownList! Why not? And if there is, can you please give me an example of what it is - 'cause I sure am not getting those choices in my VB.Net codebehind!
Thanks!
Coleen
"Even the smallest foot leaves an impression"
|
|
|
|
|
Adding the template column to Gridview is tricky. I will show you three ways to achieve your goal. but None of those ways is perfect. Each way has each own pros and cons.
1. Adding HTML dropdown to Template column
For example :
TemplateField tf = new TemplateField (); <br />
TemplateBuilder dBdr = new TemplateBuilder ();<br />
dBdr.AppendLiteralString ("<select name="\"ctl00$DefaultContent$GridView1$ctl09$DropDownList1\"" id="\"ctl00_DefaultContent_GridView1_ctl09_DropDownList1\"">");<br />
dBdr.AppendLiteralString ("</select>");<br />
tf.ItemTemplate = dBdr; <br />
<br />
GridView1.Columns.Add (tf);
2. Loading the custom control
This way is what I found in other site. I haven't tried yet. You can place all controls that you want to show in User control. Load this custom control and set it to ItemTemplate.
For example ~
<br />
TemplateField tf = new TemplateField (); <br />
tf.ItemTemplate = LoadControl("mycontrols.ascx"); <br />
GridView1.Columns.Add (tf);
3. Creating your own template column
Example : http://msdn2.microsoft.com/en-us/library/aa289501(VS.71).aspx[^]
|
|
|
|
|
Thanks Michael
Wow - no matter how you do it programmatically it is complicated! You'd think that since it is so easy to do in the ASP.Net portion (all the nice little tools to allow you to connect to your datasource and change to ItemTemplate fields) that it would be just a little less complicated to do this in code!
Thanks so very much for all of your help. At this point, what we have decided to do is to go back and re-write our connection to the DB2 database in a separate function (instead of within the VB.net codebehind of the page) and then we can connect directly to the datasource as an object. I'm still working on it, but it sure helps to have the information on how to do this programmatically. I may still end up doing it that way...Either way it is a lot more complicated because of the way in which we connect to our database (using COBOL and CICS) and calling an RPC to create a datatable to bind to. What a pain!
Again, thank you very much for your help!
Coleen
"Even the smallest foot leaves an impression"
|
|
|
|
|
Hi,
Using .netframework 2.0, I can see the My.Computer.Info.OSPlatform information for the XP I am using, i.e. "Win32NT", and and the .OSversion i.e. "5.1.2600.131072".
As I don't have a Vista pc, can anyone tell me what the My.Computer.Info.OSPlatform string would be if I was running Vista?
If the same as above, what would the version no. be like?
Thanks for your help
BillyTheKidney
|
|
|
|
|
Hi,
the OS family is identified by the first two numbers; the others depend on the exact build and optional service packs.
NT starts with 5.0.
XP starts with 5.1.
Vista starts with 6.0.
|
|
|
|
|
hi all,
i m trying to store the path of file in mysql database using vb.net. This path contains "\" but Mysql database does not store it. Also when i directly edit the field in database and insert "\" in database field then it stores backward slash.
anybody have idea where i m wrong ?
any help will be greatly appreciated.
Rupesh Kumar Swami
Software Engineer,
Integrated Solution,
Bikaner (India)
My Company
|
|
|
|
|
What does the code look like that's storing the data?? What does the schema look like for the table you're storing this data in?
I never use MySQL so my knowledge quite is limited. But, the first thing I would suspect is that MySQL is interpreting the backslash as an escape character.
You're single best source of information specific to MySQL would be the support forums at http://forums.mysql.com[^].
|
|
|
|
|
Hi All,
I am Atheeq Software Developer in VB.Net using backend SQL2000. I need help in writing Sql Query in VB.Net. Please any body help me how to write the following code in VB.Net procedure.
Select 'AsplData','Select * from Customer order by customer','C:\test.xls'
Best Regards
Atheeq
India
|
|
|
|
|
Atheeque wrote: Select 'AsplData','Select * from Customer order by customer','C:\test.xls'
Would you mind describing what you want this to do?? It doesn't mean anything in the form you've prsented it.
|
|
|
|
|
I am a vb user(addict) from vb1 up till vb6.
Trying to decide where to go (I am 68 years old)
How long can I keep on using VB6?
What would be an interesting update?
Presently a am designing a system to send alarmmessages across
the net to afully automated alarmcontroll centre.
suggestions welcome
Mark
|
|
|
|
|
johnsevennl wrote: How long can I keep on using VB6?
"Can" or "should"?? In either case, IMHO, that time has long since past. Your about 3 versions of VB.NET behind.
johnsevennl wrote: What would be an interesting update?
VB.NET 2005 or 2008. You'd probably be surprised to find you've been wasting your time writing code for so much basic stuff that comes standard in the .NET Framework.
|
|
|
|
|
Thanks for replying. I just downloaded VB express 2008.
I felt more comfortable when I tried it.
Do I miss much not using the full blown version?
Regards Mark
|
|
|
|
|
If following VB6, probably not missing much from the professional version. But you may find new stuffs that you will want to make use of in Visual Studio (ie Mobile Device Dev).
Here's a comparison chart for VS2005, VS2008 shouldn't be very far off (Haven't found the comparison chart for 2008 yet).
http://www.microway.com.au/microsoft/vs_compare.stm[^]
If it is for your company, you can always get the company to buy it.
|
|
|
|
|
|
Sounds like fun. Good luck !!!!
(seriously, this is not a question, try doing some research, start your project, and ask specific questions when you have them )
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Yet another newbie with a chat app attempt.
|
|
|
|
|
|
What do you mean by 'template' ? You can't hijack a browser on another computer via a windows program, no.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi I need help with my program I'm trying to read bits and write bits in a set of bytes.
Any Idea on how to do that under VB.net.
If you do not have an answer just don't answer. BiG RaLpH
|
|
|
|
|
Have a look at the BitVector32[^] structure. It is specifically designed to assist with bit manipulation operations.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Frnd's
I have datetimepicker control for which i need to change the forecolor to red when it is selected i.e the text should be change to Red color
Plz help me..
Thnks...
|
|
|
|
|
Requirement: In vb.net
I want to add records in gridview text boxes? how it will be possible.
Explaination:
I have gridview named gridAsset with 5 columns all are text boxes.
suppose now i am entring values in first row then after that with out saving these values in data base i want to enter another one more record.it means now grid row count is 2.
after this on click on save button it should be saved in data base.
please give me solution aspx as well as in aspx.vb in both.
Thanx
|
|
|
|