|
Hello!
I have a panel with 2 buttons and it has to be possible for user, resize the buttons.
Do you have some tipps for me?
|
|
|
|
|
You just need to set the size of the button in code, based on whatever input you choose.
|
|
|
|
|
To find "whatever input choosed by user" was my problem..
Now I have a "dirty-solution" for this problem, do you know a better (simpler) way?
<br />
private void KeyerForm_MouseMove(object sender, MouseEventArgs e)<br />
{<br />
SetCursor(e);<br />
if (this.bMDown)<br />
{<br />
int delta_x = e.X - this.StartX;<br />
int delta_y = e.Y - this.StartY;<br />
<br />
if ((this.Left + delta_x) < 0 || (this.Top + delta_y) < 0 || (this.Left + delta_x) > (this.Parent.Width - this.Width) || (this.Top + delta_y) > (this.Parent.Height - this.Height))<br />
{<br />
return;<br />
}<br />
<br />
if ((e.X < WidthOfRand || ((this.Size.Width - e.X) < WidthOfRand)) && (e.X != this.StartX))<br />
{<br />
if (e.X < WidthOfRand)<br />
{<br />
this.Width += delta_x * (-1);<br />
this.Left += delta_x;<br />
this.Refresh();<br />
this.Parent.Refresh();<br />
return;<br />
}<br />
if ((this.Size.Width - e.X) < WidthOfRand)<br />
{<br />
this.Width += delta_x;
this.catchMouse(new Point(Cursor.Position.X + delta_x, Cursor.Position.Y));<br />
this.PointToClient(Control.MousePosition);<br />
Cursor.Position = new Point(Cursor.Position.X + delta_x, Cursor.Position.Y);<br />
this.Refresh();<br />
this.Parent.Refresh();<br />
return;<br />
}<br />
return;<br />
}<br />
<br />
<br />
if ((e.Y < WidthOfRand || ((this.Size.Width - e.Y) < WidthOfRand)) && (e.Y != this.StartY))<br />
{<br />
if (e.Y < WidthOfRand)<br />
{<br />
this.Height += delta_y * (-1);<br />
this.Top += delta_y;<br />
this.Refresh();<br />
this.Parent.Refresh();<br />
}<br />
return;<br />
} <br />
if (((e.X != this.StartX) || (e.Y != this.StartY)) && (this.Cursor == Cursors.Hand))<br />
{<br />
this.Left += e.X - this.StartX;<br />
this.Top += e.Y - this.StartY;<br />
this.Refresh();<br />
this.Parent.Refresh();<br />
}<br />
}<br />
}<br />
<br />
void KeyerForm_MouseUp(object sender, MouseEventArgs e)<br />
{<br />
this.bMDown = false;<br />
}<br />
<br />
void KeyerForm_MouseDown(object sender, MouseEventArgs e)<br />
{<br />
this.StartX = e.X;<br />
this.StartY = e.Y;<br />
this.bMDown = true;<br />
}<br />
<br />
private void SetCursor(MouseEventArgs e)<br />
{<br />
if (e.Y < WidthOfRand || ((this.Size.Height - e.Y) < WidthOfRand))<br />
this.Cursor = Cursors.HSplit;<br />
else<br />
if (e.X < WidthOfRand || ((this.Size.Width - e.X) < WidthOfRand))<br />
this.Cursor = Cursors.VSplit;<br />
else<br />
this.Cursor = Cursors.Hand;<br />
}<br />
<br />
<br />
|
|
|
|
|
I came a across a tutorial, here on codeproject, explaining how to use/create a component which is like the one in visual studio. It allows the resize of a component at runtime (with little squares around the control).
Sorry I couldn't find that article but it's definitely somewhere around here :/.
|
|
|
|
|
Hi,
this is murty, i am using .net2003, AJAX. I have used AJAX for the Database related operations. i am getting data from the database, i am displaying this through Response.write(text), i got optput, but every time page load code is also executing even i have written IsPostBack=false. meanwhile i got output(responseText) with some html code, how to subtract this from the required output.
Please help me....
Murty
|
|
|
|
|
Google not working where you live ?
|
|
|
|
|
I have seen ppl using Seriable attribute for Classes. Can anyone explain me wat does Serializable mean? and why is it used?
Maddy
|
|
|
|
|
It means that the class can be serialized. Which means that it can be stored in a file (or db or wherever) and then restored from there later on (it's how sessions work for example).
--------------------------------------------------------
My portfolio & development blog
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
what are the methods that loaded when page is loaded
|
|
|
|
|
What on earth do you mean ? Do you mean in ASP.NET ? Do you want to know the order in which events are loaded ? Page init, page load, events, page pre-render, is the short version. If you mean something else, try to be more clear.
|
|
|
|
|
I made this code for get any file info:
<br />
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click<br />
Dim ParamSeparator() As String = {"GIF89a"}<br />
Dim gif As String = File.ReadAllText(OpenFileDialog1.FileName)<br />
Dim i As Integer = 0<br />
If File.Exists(OpenFileDialog1.FileName) = True Then<br />
For Each files As String In gif.Split(ParamSeparator, StringSplitOptions.None)<br />
If files.Length > 0 Then<br />
ListBox1.Items.Add(i & " " & files.Length + 6 & " 0")<br />
i = i + files.Length + 6<br />
number = number + 1<br />
End If<br />
Next<br />
TextBox1.Text = number<br />
End If<br />
End Sub<br />
But it didn't work with BinaryFiles, because i used ReadAllText, and i want to know how to edit the code for making work with Binary FIles.
Thanks For Any Help
|
|
|
|
|
flash.tato wrote: But it didn't work with BinaryFiles, because i used ReadAllText, and i want to know how to edit the code for making work with Binary FIles.
After looking at your code I cannot even figure out what you are trying to do.
|
|
|
|
|
I want take the lenght between the file Split.
For example if the Split Result is 20 byte i want that it shows the Length of the SPlit Result, but if i use ReadAllText i can't use it with Binary FIles
Young programmer
|
|
|
|
|
If you're reading a file as binary, then you'll be searching for the gif header in a binary array, not a string. So, the code needs to be rewritten to do what you want, a different way.
|
|
|
|
|
Hi All
I have written a program in vb.net 2005 for generating dynamic reports from SQLserver 2000 , the report generates successfuly but when it goes for printing with a network printer that I specify it programaticaly I get this error :
Erorr in file E:/DOCUMEN~1/admin/LOCAL~1/Temp/temp_4fc557_33455ed_{asd33dh3_dsd}.rpt
:unable to connect : incorrect logon parametrs
The code that I using for printing is :
Dim
m AsNew A4Bill
m.PrintOptions.PrinterName = "\\Arash\Microsoft Office Document Image Writer"
Try
m.PrintToPrinter(1, False, 0, 1)
Catch ex As Exception
message.Text = ex.Message
EndTry
Thanks for your Help
Arash Rajaei
|
|
|
|
|
I need a regular expression to use to split a string on whitespace but keep quoted text together.
So far I have "([^\"\\s]+)|(\"([^\"]*)\")" which seems to work fine in most cases, but as I'm new to regular expressions I wouldn't be surprised to find that there are better ways to do this (I just haven't found any).
One of the oddities of this regular expression is that a string like hi"there" gets split into two parts: hi and "there" , which may not be what most users expect.
If anyone has something better I'd like to know.
|
|
|
|
|
I didn't quite know if this is the correct forum, but I have blogged my first Mono experience over here[^], and hope to shed some light on this framework and maybe get some feedback on my initial thoughts.
|
|
|
|
|
Hi all,
Still i am confusing that why we use "N-Tier" archetectur for .NET application.?
Note:
I wnat to know what is the main advantage of N-Tier Architecture for software development?
please help me...!
Pavan Pareta
|
|
|
|
|
for me..
i'm using N-Tier archetecture because of i'm building a WAN environment system and it's need very fast connection and a lot of users from different places.. with a n-tier archetecture u can do a server farm for the middle tier of the system and this is more better that the old client-server archetecture ..
|
|
|
|
|
Seperation. It means that your presentation code, for example, is clean and easy to read, it's not full of business rules or data access code. In theory this means you can replace layers, but that almost never happens. What does happen is, the code is clean, easier to maintain and easier to read.
|
|
|
|
|
Thanks !!!!!
Sir(Christian Graus)
it use is very time consuming for developing any application which have this kind of architechture. please can you explain me properly.
thanx
Pavan Pareta
|
|
|
|
|
It doesn't really take that much longer, for any non-trivial app, it will probably take less, because it is a good step towards stopping the code turning to spagetti.
|
|
|
|
|
thanks
Can we debug Easly this kind of application.????
like i want change in DataLayer.
Pavan Pareta
|
|
|
|
|
I'm sorry, but that's a really dumb question. n-tier apps are no harder to debug than any other app.
|
|
|
|
|
I use n-tier as it is much easier to deploy an application with n-logical tiers on a single machine than to deploy an application with 1-logical tier accross n physical tiers if the need arises. I would also go as far as to say that any non-trivial app with only 1 logical tier is likely to be a very bad design. Even patterns such as the model-view-controller require the use of more than 1 logical tier even if they reside on one machine.
Russ
|
|
|
|